diff --git a/.eslintrc.js b/.eslintrc.js index 417b38f6e..867ca42f4 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,6 +1,6 @@ 'use strict'; -const { globals } = require('./').environments.globals; +const globals = require('./src/globals.json'); module.exports = { parser: '@typescript-eslint/parser', diff --git a/src/globals.json b/src/globals.json new file mode 100644 index 000000000..0b4bd79d8 --- /dev/null +++ b/src/globals.json @@ -0,0 +1,19 @@ +{ + "afterAll": false, + "afterEach": false, + "beforeAll": false, + "beforeEach": false, + "describe": false, + "expect": false, + "fit": false, + "it": false, + "jasmine": false, + "jest": false, + "pending": false, + "pit": false, + "require": false, + "test": false, + "xdescribe": false, + "xit": false, + "xtest": false +} diff --git a/src/index.js b/src/index.js index 3c0fb75c6..0e76d4da3 100644 --- a/src/index.js +++ b/src/index.js @@ -1,5 +1,6 @@ import { readdirSync } from 'fs'; import { basename, join } from 'path'; +import globals from './globals.json'; import * as snapshotProcessor from './processors/snapshot-processor'; // copied from https://github.com/babel/babel/blob/d8da63c929f2d28c401571e2a43166678c555bc4/packages/babel-helpers/src/helpers.js#L602-L606 @@ -74,25 +75,7 @@ module.exports = { }, environments: { globals: { - globals: { - afterAll: false, - afterEach: false, - beforeAll: false, - beforeEach: false, - describe: false, - expect: false, - fit: false, - it: false, - jasmine: false, - jest: false, - pending: false, - pit: false, - require: false, - test: false, - xdescribe: false, - xit: false, - xtest: false, - }, + globals, }, }, processors: {