Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

Commit cd072b1

Browse files
committed
test(apib): remove try/catch from serializeSync
Ref https://github.com/apiaryio/api-elements.js/pull/549/files#r481960957
1 parent 20ee86c commit cd072b1

File tree

1 file changed

+8
-21
lines changed

1 file changed

+8
-21
lines changed

packages/apib-serializer/test/adapter-test.js

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe('API Blueprint serializer adapter', () => {
2323
files.forEach((file) => {
2424
const apib = `${file.substr(0, file.length - 4)}apib`;
2525

26-
it(`serializes asynchronously ${path.basename(file)}`, (done) => {
26+
it(`serializes ${path.basename(file)} asynchronously`, (done) => {
2727
let serializedRefract;
2828
let expectedBlueprint;
2929
let api;
@@ -48,28 +48,15 @@ describe('API Blueprint serializer adapter', () => {
4848
});
4949
});
5050

51-
it(`serializes synchronously ${path.basename(file)}`, (done) => {
52-
let serializedRefract;
53-
let expectedBlueprint;
54-
let api;
55-
56-
try {
57-
serializedRefract = require(file);
58-
expectedBlueprint = fs.readFileSync(apib, 'utf-8');
51+
it(`serializes ${path.basename(file)} synchronously`, () => {
52+
const serializedRefract = require(file);
53+
const expectedBlueprint = fs.readFileSync(apib, 'utf-8');
5954

60-
const parseResult = fury.load(serializedRefract);
61-
({ api } = parseResult);
62-
} catch (loadErr) {
63-
return done(loadErr);
64-
}
55+
const parseResult = fury.load(serializedRefract);
56+
const { api } = parseResult;
6557

66-
try {
67-
const serialized = fury.serializeSync({ api });
68-
expect(serialized).to.deep.equal(expectedBlueprint);
69-
return done();
70-
} catch (err) {
71-
return done(err);
72-
}
58+
const serialized = fury.serializeSync({ api });
59+
expect(serialized).to.deep.equal(expectedBlueprint);
7360
});
7461
});
7562
});

0 commit comments

Comments
 (0)