Skip to content

Commit

Permalink
fix: simplified example tests (#864)
Browse files Browse the repository at this point in the history
  • Loading branch information
nitintejuja committed Aug 16, 2022
1 parent 25203c7 commit 3a13c0f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 2 additions & 3 deletions examples/adapting-input-and-output/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ describe('Should be able to generate a model with functions to serialize the dat

test('and should log expected output to console', async () => {
await generate();
//Generate is called 2x, so even though we expect 1 model, we double it
expect(spy.mock.calls.length).toEqual(2);
expect(spy.mock.calls[1]).toMatchSnapshot();
expect(spy.mock.calls.length).toEqual(1);
expect(spy.mock.calls[0]).toMatchSnapshot();
});
});
4 changes: 3 additions & 1 deletion examples/adapting-input-and-output/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,6 @@ export async function generate() : Promise<void> {
console.log(model.result);
}
}
generate();
if (require.main === module) {
generate();
}

0 comments on commit 3a13c0f

Please sign in to comment.