Merge pull request #39 from Yamboy1/patch-1

This commit is contained in:
Ross Brodbeck 2019-12-03 14:14:24 -05:00 committed by GitHub
commit 752ef589a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -5,7 +5,7 @@ import * as path from 'path'
test('throws invalid number', async() => {
const input = parseInt('foo', 10);
await expect(wait(input)).rejects.toThrow('milleseconds not a number');
await expect(wait(input)).rejects.toThrow('milliseconds not a number');
});
test('wait 500 ms', async() => {
@ -24,4 +24,4 @@ test('test runs', () => {
env: process.env
};
console.log(cp.execSync(`node ${ip}`, options).toString());
});
});

View File

@ -1,10 +1,10 @@
export function wait(milliseconds: number) {
return new Promise((resolve) => {
if (isNaN(milliseconds)) {
throw new Error('milleseconds not a number');
throw new Error('milliseconds not a number');
}
setTimeout(() => resolve("done!"), milliseconds)
});
}