Skip to content

Commit 663b624

Browse files
committed
Make test 100%
1 parent 8ca37ca commit 663b624

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import { NPM_PACKAGES_DEV, NPM_PACKAGES_PROD } from './packages';
1111
const PKG_DIR = __dirname;
1212

1313
const run = async ({ packageName }) => {
14-
if (fs.existsSync(packageName)) {
15-
throw new Error('The directory exists.');
16-
}
17-
1814
try {
15+
if (fs.existsSync(packageName)) {
16+
throw new Error('The directory exists.');
17+
}
18+
1919
await fse.mkdirp(packageName);
2020
process.chdir(packageName);
2121
const CUR_DIR = process.cwd();

tests/index.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ describe('Create NodeJs', () => {
7474
try {
7575
await run({ packageName: 'src' });
7676
} catch (error) {
77-
expect(error.message).toEqual('The directory exists.');
77+
expect(error.message).toEqual('Error: The directory exists.');
7878
}
7979
});
8080
});

0 commit comments

Comments
 (0)