Skip to content

Commit

Permalink
test: verify broken files
Browse files Browse the repository at this point in the history
  • Loading branch information
barmac committed Feb 20, 2025
1 parent f7e4f99 commit 6517a80
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 0 deletions.
59 changes: 59 additions & 0 deletions app/lib/file-context/__tests__/file-context-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,65 @@ describe('FileContext', function() {
expect(file).to.exist;
expect(file).to.have.property('type');
});


describe.only('broken files', function() {

Check failure on line 189 in app/lib/file-context/__tests__/file-context-spec.js

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Unexpected exclusive mocha test

Check failure on line 189 in app/lib/file-context/__tests__/file-context-spec.js

View workflow job for this annotation

GitHub Actions / build (macos-latest)

Unexpected exclusive mocha test

Check failure on line 189 in app/lib/file-context/__tests__/file-context-spec.js

View workflow job for this annotation

GitHub Actions / build (windows-2022)

Unexpected exclusive mocha test

Check failure on line 189 in app/lib/file-context/__tests__/file-context-spec.js

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Unexpected exclusive mocha test

Check failure on line 189 in app/lib/file-context/__tests__/file-context-spec.js

View workflow job for this annotation

GitHub Actions / build (macos-latest)

Unexpected exclusive mocha test

Check failure on line 189 in app/lib/file-context/__tests__/file-context-spec.js

View workflow job for this annotation

GitHub Actions / build (windows-2022)

Unexpected exclusive mocha test

it('should NOT throw for empty BPMN', async function() {

// given
const filePath = path.resolve(__dirname, './fixtures/broken-files/empty.dmn');

// when
const file = await fileContext.addFile(filePath);

// then
expect(file).to.exist;
expect(file).to.have.property('type');
});


it('should NOT throw for empty DMN', async function() {

// given
const filePath = path.resolve(__dirname, './fixtures/broken-files/empty.bpmn');

// when
const file = await fileContext.addFile(filePath);

// then
expect(file).to.exist;
expect(file).to.have.property('type');
});


it('should NOT throw for empty FORM', async function() {

// given
const filePath = path.resolve(__dirname, './fixtures/broken-files/empty.json');

// when
const file = await fileContext.addFile(filePath);

// then
expect(file).to.exist;
expect(file).to.have.property('type');
});


it('should NOT throw for FORM without `id`', async function() {

// given
const filePath = path.resolve(__dirname, './fixtures/broken-files/form-null.json');

// when
const file = await fileContext.addFile(filePath);

// then
expect(file).to.exist;
expect(file).to.have.property('type');
});
});
});

function createWaitFor(fileContext) {
Expand Down
Empty file.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
null

0 comments on commit 6517a80

Please sign in to comment.