Skip to content

Use NOCK_ENV=replay by default #654

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -89,5 +89,3 @@ jobs:
- run: corepack yarn build # We need the stubs to run the tests

- run: corepack yarn test
env:
NOCK_ENV: replay
2 changes: 1 addition & 1 deletion tests/_registryServer.mjs
Original file line number Diff line number Diff line change
@@ -223,7 +223,7 @@ switch (process.env.AUTH_TYPE) {
default: throw new Error(`Invalid AUTH_TYPE in env`, {cause: process.env.AUTH_TYPE});
}

if (process.env.NOCK_ENV === `replay`) {
if (process.env.NOCK_ENV !== `record`) {
const originalFetch = globalThis.fetch;
globalThis.fetch = function fetch(i) {
if (!`${i}`.startsWith(
2 changes: 1 addition & 1 deletion tests/recordRequests.js
Original file line number Diff line number Diff line change
@@ -69,7 +69,7 @@ if (process.env.NOCK_ENV === `record`) {
headers: minimalHeaders,
});
};
} else if (process.env.NOCK_ENV === `replay`) {
} else {
const getNockStatement = db.prepare(`SELECT body, json(headers) as headers, status FROM nocks WHERE hash = ?`);

globalThis.fetch = async (input, init) => {

Unchanged files with check annotations Beta

import {BaseContext, Builtins, Cli} from 'clipanion';
import type {UsageError} from 'clipanion';

Check warning on line 2 in sources/main.ts

GitHub Actions / Testing chores

'UsageError' is defined but never used
import {version as corepackVersion} from '../package.json';