Skip to content

Commit

Permalink
stupid nx dependencies messing up e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
simondotm committed Mar 28, 2024
1 parent d981fa1 commit 68a1325
Showing 1 changed file with 32 additions and 4 deletions.
36 changes: 32 additions & 4 deletions e2e/nx-firebase-e2e/tests/nx-firebase.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,18 @@ describe('nx-firebase e2e', () => {
packageJson.devDependencies['firebase-functions-test'],
).toBeDefined()
expect(packageJson.devDependencies['firebase-tools']).toBeDefined()
//SM: Mar'24: our plugin init generator now only add @nx/node
expect(packageJson.devDependencies['@nx/node']).toBeDefined()
expect(packageJson.devDependencies['@nx/esbuild']).toBeDefined()
expect(packageJson.devDependencies['@nx/linter']).toBeDefined()
expect(packageJson.devDependencies['@nx/js']).toBeDefined()
expect(packageJson.devDependencies['@nx/jest']).toBeDefined()
// @nx/node package brings in @nx/js
// https://github.com/nrwl/nx/blob/fb90767af87c77955f8b8b7cace7cd0b5e3be27d/packages/node/package.json#L32
// not in 16.8.0 it doesnt
expect(packageJson.devDependencies['@nx/js']).not.toBeDefined()
// @nx/jest, @nx/eslint are package.json dependencies in later versions of Nx
expect(packageJson.devDependencies['@nx/eslint']).not.toBeDefined()
expect(packageJson.devDependencies['@nx/jest']).not.toBeDefined()

//SM: Mar'24: esbuild is added by @nx/node when functions are generated, depending on bundler option
expect(packageJson.devDependencies['@nx/esbuild']).not.toBeDefined()
})
})

Expand Down Expand Up @@ -264,6 +271,19 @@ describe('nx-firebase e2e', () => {

validateProjectConfig(appData)

// // should still not see any nx/node related packages when generating an app
// // since we dont run the node generator in app generator
// const packageJson = readJson(`package.json`)
// // running the application generator runs the init generator, which adds @nx/node and these dependencies of @nx/node
// // SM: not in 16.8.0 it doesnt
// expect(packageJson.devDependencies['@nx/linter']).toBeDefined()
// expect(packageJson.devDependencies['@nx/eslint']).not.toBeDefined()
// // jest and js IS added somehow for 16.8.0
// expect(packageJson.devDependencies['@nx/jest']).toBeDefined()
// expect(packageJson.devDependencies['@nx/js']).toBeDefined()
// //SM: Mar'24: esbuild is added by @nx/node when functions are generated, depending on bundler option
// expect(packageJson.devDependencies['@nx/esbuild']).not.toBeDefined()

// cleanup - app
await cleanAppAsync(appData)
})
Expand Down Expand Up @@ -376,6 +396,14 @@ describe('nx-firebase e2e', () => {

validateFunctionConfig(functionData, appData)

// const packageJson = readJson(`package.json`)
// // running the function generator runs the node apo generator, which adds these dependencies of @nx/node
// expect(packageJson.devDependencies['@nx/eslint']).toBeDefined()
// expect(packageJson.devDependencies['@nx/jest']).toBeDefined()
// expect(packageJson.devDependencies['@nx/js']).toBeDefined()
// //SM: Mar'24: esbuild is added by @nx/node when functions are generated, depending on bundler option
// expect(packageJson.devDependencies['@nx/esbuild']).toBeDefined()

// cleanup
await cleanFunctionAsync(functionData)
await cleanAppAsync(appData)
Expand Down

0 comments on commit 68a1325

Please sign in to comment.