diff --git a/src/__snapshots__/secrets-sanitizer.test.ts.snap b/src/__snapshots__/secrets-sanitizer.test.ts.snap index befe45d5..da19ec9c 100644 --- a/src/__snapshots__/secrets-sanitizer.test.ts.snap +++ b/src/__snapshots__/secrets-sanitizer.test.ts.snap @@ -1,19 +1,19 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`secrets secretSanitizer should replace all secrets and leave other params 1`] = ` -Object { - "array": Array [ - Object { +{ + "array": [ + { "name": "foo", "value": "x", }, ], - "arrayOfStrings": Array [ + "arrayOfStrings": [ "x", "y", ], - "bar": Object { - "baz": Object { + "bar": { + "baz": { "foo": true, "val": "1 x 1 x x", }, diff --git a/src/config.test.ts b/src/config.test.ts index 3ba29a23..28cae55c 100644 --- a/src/config.test.ts +++ b/src/config.test.ts @@ -1,3 +1,4 @@ +/** @jest-environment setup-polly-jest/jest-environment-node */ import './jest-polly' import fetch from 'node-fetch' diff --git a/src/config.ts b/src/config.ts index 164df464..b03da850 100644 --- a/src/config.ts +++ b/src/config.ts @@ -34,7 +34,7 @@ export class JestPollyConfigService { // eslint-disable-next-line class-methods-use-this private factory(): PollyConfigWithSecrets { - const recordingsRoot = path.dirname(expect.getState().testPath) + const recordingsRoot = path.dirname(expect.getState().testPath ?? '.') const recordingsDirectory = path.join(recordingsRoot, '__recordings__') return { diff --git a/src/global.d.ts b/src/global.d.ts deleted file mode 100644 index 8290c995..00000000 --- a/src/global.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -// eslint-disable-next-line @typescript-eslint/no-unused-vars, import/no-extraneous-dependencies -import { Jasmine } from 'jest-jasmine2' - -// https://stackoverflow.com/a/49479954/1566758 -declare global { - namespace NodeJS { - interface Global { - jasmine: Jasmine - } - } -} - -export {} diff --git a/src/index.test.ts b/src/index.test.ts index 282d2072..7c55824f 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -1,3 +1,4 @@ +/** @jest-environment setup-polly-jest/jest-environment-node */ import { Polly } from '@pollyjs/core' import { jestPollyConfigService, jestPollyContext } from '.'