Socket
Socket
Sign inDemoInstall

@spotify/polly-jest-presets

Package Overview
Dependencies
107
Maintainers
4
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.1 to 3.1.0

cjs/pollyContext.d.ts

9

cjs/index.d.ts

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc