You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it('should warn when trying to process js but allowJs is false',()=>{
124
+
args[1]='/foo/bar.js'
125
+
typescript.options.allowJs=false
126
+
constlogs=logTargetMock()
127
+
logs.clear()
128
+
expect(process()).toBe(INPUT)
129
+
expect(logs.lines.warn).toMatchInlineSnapshot(`
130
+
Array [
131
+
"[level:40] Got a \`.js\` file to compile while \`allowJs\` option is not set to \`true\` (file: /foo/bar.js). To fix this:
132
+
- if you want TypeScript to process JS files, set \`allowJs\` to \`true\` in your TypeScript config (usually tsconfig.json)
133
+
- if you do not want TypeScript to process your \`.js\` files, in your Jest config change the \`transform\` key which value is \`ts-jest\` so that it does not match \`.js\` files anymore
134
+
",
135
+
]
136
+
`)
137
+
})
138
+
116
139
it('should not pass the instrument option to babel-jest',()=>{
Copy file name to clipboardExpand all lines: src/util/messages.ts
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,7 @@ export enum Errors {
12
12
NotMappingPathWithEmptyMap='Not mapping "{{path}}" because it has no target.',
13
13
MappingOnlyFirstTargetOfPath='Mapping only to first target of "{{path}}" because it has more than one ({{count}}).',
14
14
CannotPatchBabelCore6='Error while trying to patch babel-core/lib/transformation/file: {{error}}',
15
+
GotJsFileButAllowJsFalse='Got a `.js` file to compile while `allowJs` option is not set to `true` (file: {{path}}). To fix this:\n - if you want TypeScript to process JS files, set `allowJs` to `true` in your TypeScript config (usually tsconfig.json)\n - if you do not want TypeScript to process your `.js` files, in your Jest config change the `transform` key which value is `ts-jest` so that it does not match `.js` files anymore',
0 commit comments