Skip to content

Commit 097b9cc

Browse files
authored
Merge pull request #13 from diujin/feature/6
added test for #6 3d
2 parents 4694e34 + fdab154 commit 097b9cc

3 files changed

Lines changed: 820 additions & 1 deletion

File tree

packages/idea-transformer/tests/Transformer.test.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { TypeConfig } from '@stackpress/idea-parser';
99
//resusable variables
1010
const cwd = __dirname;
1111
const idea = path.resolve(cwd, 'schema.idea');
12+
const use = path.resolve(cwd, 'use.idea');
1213

1314
describe('Transformer Tests', () => {
1415
it('Should get processed schema', () => {
@@ -92,7 +93,15 @@ describe('Transformer Tests', () => {
9293
expect(parentType.attributes).to.deep.equal({ name: 'parent' });
9394
});
9495

95-
96+
it('Should allow use json file into an idea file', () => {
97+
const transformerIdea = new Transformer(idea, { cwd });
98+
const transformerJson = new Transformer(use, { cwd });
99+
// Get the final schemas
100+
const useIdea = transformerIdea.schema;
101+
const useJson = transformerJson.schema;
102+
// Check if the merged json file is deeply equal to the merged idea file
103+
expect(useJson).to.deep.equal(useIdea);
104+
});
96105

97106

98107
});

0 commit comments

Comments
 (0)