Skip to content

Commit

Permalink
test: set jest environment
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyentoanit committed Sep 30, 2022
1 parent 3e41d2b commit d284328
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 20 deletions.
12 changes: 6 additions & 6 deletions src/__snapshots__/secrets-sanitizer.test.ts.snap
Original file line number Diff line number Diff line change
@@ -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",
},
Expand Down
1 change: 1 addition & 0 deletions src/config.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/** @jest-environment setup-polly-jest/jest-environment-node */
import './jest-polly'

import fetch from 'node-fetch'
Expand Down
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
13 changes: 0 additions & 13 deletions src/global.d.ts

This file was deleted.

1 change: 1 addition & 0 deletions src/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/** @jest-environment setup-polly-jest/jest-environment-node */
import { Polly } from '@pollyjs/core'

import { jestPollyConfigService, jestPollyContext } from '.'
Expand Down

0 comments on commit d284328

Please sign in to comment.