Skip to content

Commit 50b5c38

Browse files
author
Jason Kuhrt
authored
chore: force color always in tests (#1038)
1 parent c05282c commit 50b5c38

File tree

4 files changed

+15
-19
lines changed

4 files changed

+15
-19
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
"postpublish": "yarn clean",
106106
"postinstall": "node scripts/postinstall",
107107
"prepublishOnly": "yarn build",
108-
"test": "LOG_PRETTY=true DEBUG=true jest --verbose --testTimeout 360000 --forceExit",
108+
"test": "FORCE_COLOR=3 LOG_PRETTY=true DEBUG=true jest --verbose --testTimeout 360000 --forceExit",
109109
"test:unit": "yarn test src",
110110
"dev:test": "yarn test --watch src",
111111
"dev": "yarn clean && node scripts/build-module-facades && tsc -b tsconfig.cjs.json -w"

src/lib/layout/index.spec.ts

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
process.env.FORCE_COLOR = '0'
2-
31
import { log } from '@nexus/logger'
42
import { defaultsDeep } from 'lodash'
53
import stripAnsi from 'strip-ansi'
@@ -202,8 +200,8 @@ describe('tsconfig', () => {
202200
})
203201
await ctx.createLayoutThrow()
204202
expect(mockedStdoutBuffer).toMatchInlineSnapshot(`
205-
"▲ nexus:tsconfig You have set \`compilerOptions.tsBuildInfoFile\` in your tsconfig.json but it will be ignored by Nexus. Nexus manages this value internally.
206-
▲ nexus:tsconfig You have set \`compilerOptions.incremental\` in your tsconfig.json but it will be ignored by Nexus. Nexus manages this value internally.
203+
"▲ nexus:tsconfig You have set [93m\`compilerOptions.tsBuildInfoFile\`[39m in your tsconfig.json but it will be ignored by Nexus. Nexus manages this value internally.
204+
▲ nexus:tsconfig You have set [93m\`compilerOptions.incremental\`[39m in your tsconfig.json but it will be ignored by Nexus. Nexus manages this value internally.
207205
"
208206
`)
209207
})
@@ -217,8 +215,8 @@ describe('tsconfig', () => {
217215
218216
\\"plugins\\": [{ \\"name\\": \\"nexus/typescript-language-service\\" }]
219217
220-
▲ nexus:tsconfig Please set your tsconfig.json \`compilerOptions.rootDir\` to \\".\\"
221-
▲ nexus:tsconfig Please set your tsconfig.json \`include\` to have \\".\\"
218+
▲ nexus:tsconfig Please set your tsconfig.json [93m\`compilerOptions.rootDir\`[39m to \\".\\"
219+
▲ nexus:tsconfig Please set your tsconfig.json [93m\`include\`[39m to have \\".\\"
222220
"
223221
`)
224222
expect(layout.tsConfig.content.raw.compilerOptions.rootDir).toEqual('.')
@@ -233,20 +231,20 @@ describe('tsconfig', () => {
233231

234232
await ctx.createLayoutThrow()
235233
expect(mockedStdoutBuffer).toMatchInlineSnapshot(`
236-
"▲ nexus:tsconfig You have not added the Nexus TypeScript Language Service Plugin to your configured TypeScript plugins. Add this to your tsconfig compiler options:
234+
"▲ nexus:tsconfig You have not added the Nexus TypeScript Language Service Plugin to your configured TypeScript plugins. Add this to your tsconfig compiler options:
237235
238-
\\"plugins\\": [{\\"name\\":\\"foobar\\"},{\\"name\\":\\"nexus/typescript-language-service\\"}]
236+
[93m\\"plugins\\": [{\\"name\\":\\"foobar\\"},{\\"name\\":\\"nexus/typescript-language-service\\"}][39m
239237
240-
"
241-
`)
238+
"
239+
`)
242240
})
243241
it('does not support use of compilerOptions.types', async () => {
244242
ctx.setup({
245243
'tsconfig.json': tsconfigSource({ compilerOptions: { types: [] } }),
246244
})
247245
await ctx.createLayoutThrow()
248246
expect(mockedStdoutBuffer).toMatchInlineSnapshot(`
249-
"■ nexus:tsconfig You have set \`compilerOptions.types\` in your tsconfig.json but Nexus does not support it. If you do not remove your customization you may/will (e.g. VSCode) see inconsistent results between your IDE and what Nexus tells you at build time. If you would like to see Nexus support this setting please chime in at https://github.com/graphql-nexus/nexus/issues/1036.
247+
"■ nexus:tsconfig You have set [93m\`compilerOptions.types\`[39m in your tsconfig.json but Nexus does not support it. If you do not remove your customization you may/will (e.g. VSCode) see inconsistent results between your IDE and what Nexus tells you at build time. If you would like to see Nexus support this setting please chime in at https://github.com/graphql-nexus/nexus/issues/1036.
250248
"
251249
`)
252250
})
@@ -256,7 +254,7 @@ describe('tsconfig', () => {
256254
})
257255
await ctx.createLayoutThrow()
258256
expect(mockedStdoutBuffer).toMatchInlineSnapshot(`
259-
"■ nexus:tsconfig You have set \`compilerOptions.typeRoots\` in your tsconfig.json but Nexus does not support it. If you do not remove your customization you may/will (e.g. VSCode) see inconsistent results between your IDE and what Nexus tells you at build time. If you would like to see Nexus support this setting please chime in at https://github.com/graphql-nexus/nexus/issues/1036.
257+
"■ nexus:tsconfig You have set [93m\`compilerOptions.typeRoots\`[39m in your tsconfig.json but Nexus does not support it. If you do not remove your customization you may/will (e.g. VSCode) see inconsistent results between your IDE and what Nexus tells you at build time. If you would like to see Nexus support this setting please chime in at https://github.com/graphql-nexus/nexus/issues/1036.
260258
"
261259
`)
262260
})
@@ -266,7 +264,7 @@ describe('tsconfig', () => {
266264
})
267265
await ctx.createLayoutThrow()
268266
expect(mockedStdoutBuffer).toMatchInlineSnapshot(`
269-
"■ nexus:tsconfig You have set \`compilerOptions.typeRoots\` and \`compilerOptions.types\` in your tsconfig.json but Nexus does not support them. If you do not remove your customization you may/will (e.g. VSCode) see inconsistent results between your IDE and what Nexus tells you at build time. If you would like to see Nexus support these settings please chime in at https://github.com/graphql-nexus/nexus/issues/1036.
267+
"■ nexus:tsconfig You have set [93m\`compilerOptions.typeRoots\`[39m and [93m\`compilerOptions.types\`[39m in your tsconfig.json but Nexus does not support them. If you do not remove your customization you may/will (e.g. VSCode) see inconsistent results between your IDE and what Nexus tells you at build time. If you would like to see Nexus support these settings please chime in at https://github.com/graphql-nexus/nexus/issues/1036.
270268
"
271269
`)
272270
})
@@ -340,7 +338,7 @@ it('fails if no entrypoint and no nexus modules', async () => {
340338
■ nexus:layout Please do one of the following:
341339
342340
1. Create a file, import { schema } from 'nexus' and write your GraphQL type definitions in it.
343-
2. Create an app.ts file.
341+
2. Create an [33mapp.ts[39m file.
344342
345343
346344
--- process.exit(1) ---

src/runtime/__snapshots__/app.spec.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
exports[`assemble warnings when api features used after assembly schema.use 1`] = `
44
Array [
55
Array [
6-
"▲ nexus Cannot call app.schema.use(...) after app.assemble()
6+
"▲ nexus Cannot call [33mapp.schema.use[39m(...) after app.assemble()
77
88
The Nexus Schema plugin you used will be ignored.
99
",
@@ -14,7 +14,7 @@ The Nexus Schema plugin you used will be ignored.
1414
exports[`assemble warnings when api features used after assembly settings.change 1`] = `
1515
Array [
1616
Array [
17-
"▲ nexus Cannot call app.settings.change(...) after app.assemble()
17+
"▲ nexus Cannot call [33mapp.settings.change[39m(...) after app.assemble()
1818
1919
Your change of settings will be ignored.
2020
",

src/runtime/app.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
process.env.FORCE_COLOR = '0'
2-
31
import { log } from '@nexus/logger'
42
import * as Lo from 'lodash'
53
import { removeReflectionStage, setReflectionStage } from '../lib/reflection'

0 commit comments

Comments
 (0)