@spotify/polly-jest-presets
Advanced tools
Comparing version 3.0.1 to 3.1.0
@@ -1,7 +0,2 @@ | ||
declare type PollyContext = { | ||
polly: import('@pollyjs/core').Polly & { | ||
config: import('@pollyjs/core').PollyConfig; | ||
}; | ||
}; | ||
export declare const pollyContext: PollyContext; | ||
export {}; | ||
import './setupPersistedMessage'; | ||
export { pollyContext } from './pollyContext'; |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const path_1 = __importDefault(require("path")); | ||
const setup_polly_jest_1 = require("setup-polly-jest"); | ||
const core_1 = require("@pollyjs/core"); | ||
const adapter_node_http_1 = __importDefault(require("@pollyjs/adapter-node-http")); | ||
const persister_fs_1 = __importDefault(require("@pollyjs/persister-fs")); | ||
const lodash_merge_1 = __importDefault(require("lodash.merge")); | ||
core_1.Polly.register(adapter_node_http_1.default); | ||
core_1.Polly.register(persister_fs_1.default); | ||
const mode = process.env.POLLY_MODE || 'replay'; | ||
const defaultConfig = { | ||
adapters: ['node-http'], | ||
persister: 'fs', | ||
persisterOptions: { | ||
keepUnusedRequests: false, | ||
fs: { | ||
recordingsDir: getDefaultRecordingDir(), | ||
}, | ||
}, | ||
mode, | ||
recordIfMissing: false, | ||
recordFailedRequests: true, | ||
expiryStrategy: 'warn', | ||
expiresIn: '14d', | ||
matchRequestsBy: { | ||
headers: false, | ||
body: false, | ||
}, | ||
}; | ||
exports.pollyContext = setup_polly_jest_1.setupPolly(lodash_merge_1.default({}, defaultConfig, global.pollyConfig)); | ||
afterEach(() => exports.pollyContext.polly.flush()); | ||
function getDefaultRecordingDir() { | ||
const testPath = global.jasmine.testPath; | ||
return path_1.default.relative(process.cwd(), `${path_1.default.dirname(testPath)}/__recordings__`); | ||
} | ||
require("./setupPersistedMessage"); | ||
var pollyContext_1 = require("./pollyContext"); | ||
exports.pollyContext = pollyContext_1.pollyContext; | ||
//# sourceMappingURL=index.js.map |
@@ -1,7 +0,2 @@ | ||
declare type PollyContext = { | ||
polly: import('@pollyjs/core').Polly & { | ||
config: import('@pollyjs/core').PollyConfig; | ||
}; | ||
}; | ||
export declare const pollyContext: PollyContext; | ||
export {}; | ||
import './setupPersistedMessage'; | ||
export { pollyContext } from './pollyContext'; |
@@ -1,35 +0,3 @@ | ||
import path from 'path'; | ||
import { setupPolly } from 'setup-polly-jest'; | ||
import { Polly } from '@pollyjs/core'; | ||
import NodeHttpAdapter from '@pollyjs/adapter-node-http'; | ||
import FSPersister from '@pollyjs/persister-fs'; | ||
import merge from 'lodash.merge'; | ||
Polly.register(NodeHttpAdapter); | ||
Polly.register(FSPersister); | ||
const mode = process.env.POLLY_MODE || 'replay'; | ||
const defaultConfig = { | ||
adapters: ['node-http'], | ||
persister: 'fs', | ||
persisterOptions: { | ||
keepUnusedRequests: false, | ||
fs: { | ||
recordingsDir: getDefaultRecordingDir(), | ||
}, | ||
}, | ||
mode, | ||
recordIfMissing: false, | ||
recordFailedRequests: true, | ||
expiryStrategy: 'warn', | ||
expiresIn: '14d', | ||
matchRequestsBy: { | ||
headers: false, | ||
body: false, | ||
}, | ||
}; | ||
export const pollyContext = setupPolly(merge({}, defaultConfig, global.pollyConfig)); | ||
afterEach(() => pollyContext.polly.flush()); | ||
function getDefaultRecordingDir() { | ||
const testPath = global.jasmine.testPath; | ||
return path.relative(process.cwd(), `${path.dirname(testPath)}/__recordings__`); | ||
} | ||
import './setupPersistedMessage'; | ||
export { pollyContext } from './pollyContext'; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@spotify/polly-jest-presets", | ||
"version": "3.0.1", | ||
"version": "3.1.0", | ||
"description": "Presets for Jest that make Polly.js plug-and-play", | ||
@@ -5,0 +5,0 @@ "main": "cjs/index.js", |
@@ -1,8 +0,3 @@ | ||
declare type PollyContext = { | ||
polly: import('@pollyjs/core').Polly & { | ||
config: import('@pollyjs/core').PollyConfig; | ||
}; | ||
}; | ||
export declare const pollyContext: PollyContext; | ||
export {}; | ||
import './setupPersistedMessage'; | ||
export { pollyContext } from './pollyContext'; | ||
//# sourceMappingURL=index.d.ts.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
32347
35
264
2
1