Skip to content

Commit

Permalink
refactor: move nock setup to hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinKolarik committed Aug 5, 2024
1 parent 63911e5 commit 9127605
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
3 changes: 0 additions & 3 deletions .mocharc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
"extension": [
"ts"
],
"file": [
"test/setup.ts"
],
"node-option": [
"experimental-specifier-resolution=node",
"loader=ts-node/esm",
Expand Down
4 changes: 4 additions & 0 deletions test/hooks.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as chai from 'chai';
import nock from 'nock';

import chaiSnapshot from './plugins/snapshot/index.js';

Expand All @@ -18,6 +19,9 @@ export const mochaHooks = {
}, { threshold: 100 });
}).catch(console.error);
}

nock.disableNetConnect();
nock.enableNetConnect('127.0.0.1');
},
afterAll () {
if (Number(process.env['PRUNE_OLD_SNAPSHOTS'])) {
Expand Down
5 changes: 0 additions & 5 deletions test/setup.ts

This file was deleted.

0 comments on commit 9127605

Please sign in to comment.