Skip to content

Commit

Permalink
fix: make npm smoke test not strict nock
Browse files Browse the repository at this point in the history
  • Loading branch information
reggi committed Dec 5, 2024
1 parent e30b8df commit 80c87f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 4 additions & 2 deletions smoke-tests/test/fixtures/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ const getCleanPaths = async () => {
})
}

module.exports = async (t, { testdir = {}, debug, mockRegistry = true, useProxy = false } = {}) => {
module.exports = async (t, {
testdir = {}, debug, mockRegistry = true, strictRegistryNock = true, useProxy = false,
} = {}) => {
const debugLog = debug || CI ? (...a) => t.comment(...a) : () => {}
debugLog({ SMOKE_PUBLISH_TARBALL, CI })

Expand Down Expand Up @@ -103,7 +105,7 @@ module.exports = async (t, { testdir = {}, debug, mockRegistry = true, useProxy
tap: t,
registry: MOCK_REGISTRY,
debug,
strict: true,
strict: strictRegistryNock,
})

const proxyEnv = {}
Expand Down
3 changes: 1 addition & 2 deletions smoke-tests/test/npm-replace-global.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ t.test('publish and replace global self', async t => {
getPaths,
paths: { globalBin, globalNodeModules, cache },
} = await setupNpmGlobal(t, {
strictRegistryNock: false,
testdir: {
home: {
'.npmrc': `//${setup.MOCK_REGISTRY.host}/:_authToken = test-token`,
Expand Down Expand Up @@ -136,8 +137,6 @@ t.test('publish and replace global self', async t => {
if (setup.SMOKE_PUBLISH) {
await npmPackage()
}
registry.nock.get('/npm').reply(404, 'not found')
registry.nock.get('/npm').reply(404, 'not found')
registry.nock.put('/npm', body => {
if (body._id === 'npm' && body.versions[version]) {
publishedPackument = body.versions[version]
Expand Down

0 comments on commit 80c87f1

Please sign in to comment.