Skip to content

Commit 80c87f1

Browse files
committed
fix: make npm smoke test not strict nock
1 parent e30b8df commit 80c87f1

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

smoke-tests/test/fixtures/setup.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ const getCleanPaths = async () => {
7373
})
7474
}
7575

76-
module.exports = async (t, { testdir = {}, debug, mockRegistry = true, useProxy = false } = {}) => {
76+
module.exports = async (t, {
77+
testdir = {}, debug, mockRegistry = true, strictRegistryNock = true, useProxy = false,
78+
} = {}) => {
7779
const debugLog = debug || CI ? (...a) => t.comment(...a) : () => {}
7880
debugLog({ SMOKE_PUBLISH_TARBALL, CI })
7981

@@ -103,7 +105,7 @@ module.exports = async (t, { testdir = {}, debug, mockRegistry = true, useProxy
103105
tap: t,
104106
registry: MOCK_REGISTRY,
105107
debug,
106-
strict: true,
108+
strict: strictRegistryNock,
107109
})
108110

109111
const proxyEnv = {}

smoke-tests/test/npm-replace-global.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ t.test('publish and replace global self', async t => {
103103
getPaths,
104104
paths: { globalBin, globalNodeModules, cache },
105105
} = await setupNpmGlobal(t, {
106+
strictRegistryNock: false,
106107
testdir: {
107108
home: {
108109
'.npmrc': `//${setup.MOCK_REGISTRY.host}/:_authToken = test-token`,
@@ -136,8 +137,6 @@ t.test('publish and replace global self', async t => {
136137
if (setup.SMOKE_PUBLISH) {
137138
await npmPackage()
138139
}
139-
registry.nock.get('/npm').reply(404, 'not found')
140-
registry.nock.get('/npm').reply(404, 'not found')
141140
registry.nock.put('/npm', body => {
142141
if (body._id === 'npm' && body.versions[version]) {
143142
publishedPackument = body.versions[version]

0 commit comments

Comments
 (0)