Skip to content

Commit aa34f02

Browse files
committed
test: check number of errors thrown in config verification
1 parent 8726eff commit aa34f02

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/verify-config.test.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,27 @@ test('Verify "npmPublish", "tarballDir" and "pkgRoot" options', async t => {
1414

1515
test('Return SemanticReleaseError if "npmPublish" option is not a Boolean', async t => {
1616
const npmPublish = 42;
17-
const [error] = await verify({npmPublish}, {}, t.context.logger);
17+
const [error, ...errors] = await verify({npmPublish}, {}, t.context.logger);
1818

19+
t.is(errors.length, 0);
1920
t.is(error.name, 'SemanticReleaseError');
2021
t.is(error.code, 'EINVALIDNPMPUBLISH');
2122
});
2223

2324
test('Return SemanticReleaseError if "tarballDir" option is not a String', async t => {
2425
const tarballDir = 42;
25-
const [error] = await verify({tarballDir}, {}, t.context.logger);
26+
const [error, ...errors] = await verify({tarballDir}, {}, t.context.logger);
2627

28+
t.is(errors.length, 0);
2729
t.is(error.name, 'SemanticReleaseError');
2830
t.is(error.code, 'EINVALIDTARBALLDIR');
2931
});
3032

3133
test('Return SemanticReleaseError if "pkgRoot" option is not a String', async t => {
3234
const pkgRoot = 42;
33-
const [error] = await verify({pkgRoot}, {}, t.context.logger);
35+
const [error, ...errors] = await verify({pkgRoot}, {}, t.context.logger);
3436

37+
t.is(errors.length, 0);
3538
t.is(error.name, 'SemanticReleaseError');
3639
t.is(error.code, 'EINVALIDPKGROOT');
3740
});

0 commit comments

Comments
 (0)