support typescript in jest files (#3132)

This commit is contained in:
Joel Einbinder 2020-07-24 14:46:59 -07:00 committed by GitHub
parent 6a4195fd1d
commit 0a57c2b39e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -13,3 +13,4 @@ src/webkit/protocol.ts
/index.d.ts
utils/generate_types/overrides.d.ts
utils/generate_types/test/test.ts
test/

View File

@ -8,6 +8,18 @@ module.exports = /** @type {import('@jest/types').Config.InitialOptions} */ ({
testTimeout: 10000,
globalSetup: './jest/setup.js',
globalTeardown: './jest/teardown.js',
transform: {
'^.+\\.ts$': ['babel-jest', {
presets: [
['@babel/preset-env', {
targets: {
node: 'current'
}
}],
['@babel/preset-typescript']
],
}],
},
reporters: [
'default',
'./jest/reporter'