Skip to content

Commit ba037de

Browse files
committed
revert some changes
1 parent d615681 commit ba037de

File tree

4 files changed

+87
-79
lines changed

4 files changed

+87
-79
lines changed

.config/rollup.dist.config.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,12 @@ export default () => {
384384
!!constants.ENV[SOCKET_CLI_SENTRY_BUILD]
385385
)
386386
],
387+
[
388+
VITEST,
389+
() =>
390+
// Lazily access constants.ENV[TAP].
391+
!!constants.ENV[VITEST]
392+
]
387393
].reduce((obj, { 0: name, 1: value }) => {
388394
obj[`process.env.${name}`] = value
389395
obj[`process.env['${name}']`] = value

package-lock.json

Lines changed: 74 additions & 73 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"test": "run-s check build:* test:* test:coverage:*",
6060
"test-ci": "run-s build:* test:*",
6161
"test:unit": "vitest --run",
62-
"test:coverage:c8": "vitest run --coverage --coverage.reportsDirectory ./coverage/tmp --coverage.exclude=test/dist/** test/socket-npm.test.cjs",
62+
"test:coverage:c8": "vitest run --coverage --coverage.reportsDirectory ./coverage/tmp --coverage.exclude=test/dist/** test/socket-npm.test.ts",
6363
"test:coverage:merge": "c8 --reporter=lcov --reporter=text --include 'dist/{module-sync,require}/*.js' --exclude 'dist/require/vendor.js' report",
6464
"update": "run-p --aggregate-output update:**",
6565
"update:deps": "npx --yes npm-check-updates"
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@ const spawn = require('@npmcli/promise-spawn')
88

99
const constants = require('../dist/constants.js')
1010

11-
const { NODE_MODULES, NPM } = constants
11+
const { CLI, NODE_MODULES, NPM, abortSignal } = constants
1212

1313
const testPath = __dirname
1414
const npmFixturesPath = path.join(testPath, 'socket-npm-fixtures')
1515

1616
// These aliases are defined in package.json.
17-
const versions = ['npm8', 'npm10']
18-
for (const npmDir of versions) {
17+
for (const npmDir of ['npm8', 'npm10']) {
1918
const npmPath = path.join(npmFixturesPath, npmDir)
2019
const npmBinPath = path.join(npmPath, NODE_MODULES, '.bin')
2120

@@ -24,13 +23,14 @@ for (const npmDir of versions) {
2423
)
2524
spawnSync(NPM, ['install', '--silent'], {
2625
cwd: npmPath,
26+
signal: abortSignal,
2727
stdio: 'ignore'
2828
})
2929
console.log(`End of npm i`)
3030

3131
describe(`Socket npm wrapper for ${npmDir}`, () => {
3232
// Lazily access constants.rootBinPath.
33-
const entryPath = path.join(constants['rootBinPath'], 'cli.js')
33+
const entryPath = path.join(constants['rootBinPath'], `${CLI}.js`)
3434

3535
it('should bail on new typosquat', async () => {
3636
await new Promise<void>((resolve, reject) => {
@@ -43,7 +43,8 @@ for (const npmDir of versions) {
4343
cwd: path.join(npmFixturesPath, 'lacking-typosquat'),
4444
env: {
4545
PATH: `${npmBinPath}:${process.env.PATH}`
46-
}
46+
},
47+
signal: abortSignal
4748
}
4849
)
4950
spawnPromise.process.stdout.on('data', (buffer: Buffer) => {

0 commit comments

Comments
 (0)