@@ -7,6 +7,7 @@ import { Linter } from '@nrwl/linter';
7
7
8
8
// eslint-disable-next-line @typescript-eslint/no-var-requires
9
9
const devkit = require ( '@nrwl/devkit' ) ;
10
+ const getInstalledNxVersionModule = require ( '../../utils/get-installed-nx-version' ) ;
10
11
11
12
describe ( 'qwik-nx generator' , ( ) => {
12
13
let appTree : Tree ;
@@ -21,6 +22,9 @@ describe('qwik-nx generator', () => {
21
22
} ;
22
23
23
24
jest . spyOn ( devkit , 'ensurePackage' ) . mockReturnValue ( Promise . resolve ( ) ) ;
25
+ jest
26
+ . spyOn ( getInstalledNxVersionModule , 'getInstalledNxVersion' )
27
+ . mockReturnValue ( '15.6.0' ) ;
24
28
25
29
beforeEach ( ( ) => {
26
30
appTree = createTreeWithEmptyWorkspace ( { layout : 'apps-libs' } ) ;
@@ -50,7 +54,7 @@ describe('qwik-nx generator', () => {
50
54
} ) ;
51
55
const config = readProjectConfiguration ( appTree , 'myapp-e2e' ) ;
52
56
expect ( config ) . toBeDefined ( ) ;
53
- expect ( config . targets . e2e . executor ) . toEqual ( '@nxkit/playwright:test' ) ;
57
+ expect ( config . targets ? .e2e . executor ) . toEqual ( '@nxkit/playwright:test' ) ;
54
58
expect (
55
59
appTree . exists ( 'apps/myapp-e2e/playwright.config.ts' )
56
60
) . toBeTruthy ( ) ;
@@ -63,7 +67,7 @@ describe('qwik-nx generator', () => {
63
67
} ) ;
64
68
const config = readProjectConfiguration ( appTree , 'myapp-e2e' ) ;
65
69
expect ( config ) . toBeDefined ( ) ;
66
- expect ( config . targets . e2e . executor ) . toEqual ( '@nrwl/cypress:cypress' ) ;
70
+ expect ( config . targets ? .e2e . executor ) . toEqual ( '@nrwl/cypress:cypress' ) ;
67
71
expect ( appTree . exists ( 'apps/myapp-e2e/cypress.config.ts' ) ) . toBeTruthy ( ) ;
68
72
} ) ;
69
73
} ) ;
0 commit comments