Skip to content

Commit

Permalink
feat: ad nodeamon test
Browse files Browse the repository at this point in the history
  • Loading branch information
akitaSummer committed Jan 25, 2024
1 parent ed2cf09 commit f297d86
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions integration/index.2.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,32 @@ describe('test/index.v2.test.js', () => {
await setTimeoutPromise(20000);
assert.strictEqual(require(path.join(cwd, 'node_modules', 'esbuild/package.json')).version, '0.15.14');
});

it('should not work', async () => {
cwd = path.join(__dirname, './fixtures/esbuild');
await coffee
.fork(rapid, [
'install',
'--ignore-scripts',
'--nodaemon',
], {
cwd,
})
.debug()
.expect('code', 0)
.end();

const dirs = await fs.readdir(path.join(cwd, 'node_modules'));
assert.strictEqual(dirs.filter(dir => dir.includes('esbuild')).length, 2);
await assert.doesNotReject(fs.stat(path.join(cwd, 'node_modules/esbuild')));
assert.strictEqual(require(path.join(cwd, 'node_modules', 'esbuild/package.json')).version, '0.15.14');
const nodeModulesDir = path.join(cwd, 'node_modules');

await execa.command(`umount -f ${nodeModulesDir}`);

Check warning

Code scanning / CodeQL

Shell command built from environment values Medium

This shell command depends on an uncontrolled
absolute path
.
This shell command depends on an uncontrolled
absolute path
.
This shell command depends on an uncontrolled
absolute path
.
This shell command depends on an uncontrolled
absolute path
.
This shell command depends on an uncontrolled
absolute path
.
This shell command depends on an uncontrolled
absolute path
.
This shell command depends on an uncontrolled
absolute path
.
This shell command depends on an uncontrolled
absolute path
.
This shell command depends on an uncontrolled
absolute path
.
This shell command depends on an uncontrolled
absolute path
.
This shell command depends on an uncontrolled
absolute path
.
await setTimeoutPromise(20000);

await assert.rejects(fs.stat(path.join(cwd, 'node_modules', 'esbuild/package.json')));
});
});

});

0 comments on commit f297d86

Please sign in to comment.