Skip to content

Commit a6552f1

Browse files
committed
fixup! fix(*): throw Error objects to help with debugging
1 parent ea2950e commit a6552f1

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

test/unit/auth.test.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,40 +62,39 @@ describe('auth', async function() {
6262
await runAuthScript(
6363
{},
6464
[FIRST_TIME_MSG],
65-
'Could not get token: Bad credentials\n', 'run-auth-error'
65+
/Could not get token: Bad credentials\n/, 'run-auth-error'
6666
);
6767
});
6868

6969
it('does not accept a non-string username', async function() {
7070
await runAuthScript(
7171
{ HOME: { username: {}, token: '0123456789abcdef' } },
7272
[],
73-
'username must be a string, received object\n'
73+
/username must be a string, received object\n/
7474
);
7575
});
7676

7777
it('does not accept a non-string token', async function() {
7878
await runAuthScript(
7979
{ HOME: { username: 'nyancat', token: 42 } },
8080
[],
81-
'token must be a string, received number\n'
81+
/token must be a string, received number\n/
8282
);
8383
});
8484

8585
it('does not accept an invalid username format', async function() {
8686
await runAuthScript(
8787
{ HOME: { username: ' ^^^ ', token: '0123456789abcdef' } },
8888
[],
89-
'username may only contain alphanumeric characters or hyphens, ' +
90-
'received ^^^ \n'
89+
/username may only contain alphanumeric characters or hyphens, received \^\^\^ \n/
9190
);
9291
});
9392

9493
it('does not accept an invalid token format', async function() {
9594
await runAuthScript(
9695
{ HOME: { username: 'nyancat', token: '@fhqwhgads' } },
9796
[],
98-
'token is misformatted: @fhqwhgads\n'
97+
/token is misformatted: @fhqwhgads\n/
9998
);
10099
});
101100

0 commit comments

Comments
 (0)