Skip to content

Commit

Permalink
fix: class and controller tests
Browse files Browse the repository at this point in the history
  • Loading branch information
garritfra committed Jun 19, 2022
1 parent c96a604 commit 5902134
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions src/lib/class/class.factory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ describe('Class Factory', () => {
});
it('should create a spec file', async () => {
const options: ClassOptions = {
name: 'foo.entity',
name: 'foo',
spec: true,
flat: true,
};
Expand All @@ -142,12 +142,12 @@ describe('Class Factory', () => {
const files: string[] = tree.files;

expect(
files.find((filename) => filename === '/foo.entity.spec.ts'),
files.find((filename) => filename === '/foo.spec.ts'),
).not.toBeUndefined();
});
it('should create a spec file with custom file suffix', async () => {
const options: ClassOptions = {
name: 'foo.entity',
name: 'foo',
spec: true,
specFileSuffix: 'test',
flat: true,
Expand All @@ -158,10 +158,10 @@ describe('Class Factory', () => {
const files: string[] = tree.files;

expect(
files.find((filename) => filename === '/foo.entity.spec.ts'),
files.find((filename) => filename === '/foo.spec.ts'),
).toBeUndefined();
expect(
files.find((filename) => filename === '/foo.entity.test.ts'),
).not.toBeUndefined();
files.find((filename) => filename === '/foo.test.ts'),
).toBeDefined();
});
});
8 changes: 4 additions & 4 deletions src/lib/controller/controller.factory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,12 @@ describe('Controller Factory', () => {
});
it('should create a spec file', async () => {
const options: ControllerOptions = {
name: 'foo.controller',
name: 'foo',
spec: true,
flat: true,
};
const tree: UnitTestTree = await runner
.runSchematicAsync('class', options)
.runSchematicAsync('controller', options)
.toPromise();
const files: string[] = tree.files;

Expand All @@ -247,13 +247,13 @@ describe('Controller Factory', () => {
});
it('should create a spec file with custom file suffix', async () => {
const options: ControllerOptions = {
name: 'foo.controller',
name: 'foo',
spec: true,
specFileSuffix: 'test',
flat: true,
};
const tree: UnitTestTree = await runner
.runSchematicAsync('class', options)
.runSchematicAsync('controller', options)
.toPromise();
const files: string[] = tree.files;

Expand Down

0 comments on commit 5902134

Please sign in to comment.