|
1 |
| -import {wait} from '../src/wait' |
2 |
| -import * as process from 'process' |
3 |
| -import * as cp from 'child_process' |
4 |
| -import * as path from 'path' |
| 1 | +import { wait } from '../src/wait'; |
| 2 | +import * as process from 'process'; |
| 3 | +import * as cp from 'child_process'; |
| 4 | +import * as path from 'path'; |
5 | 5 |
|
6 | 6 | test('throws invalid number', async () => {
|
7 |
| - const input = parseInt('foo', 10) |
8 |
| - await expect(wait(input)).rejects.toThrow('milliseconds not a number') |
9 |
| -}) |
| 7 | + const input = parseInt('foo', 10); |
| 8 | + await expect(wait(input)).rejects.toThrow('milliseconds not a number'); |
| 9 | +}); |
10 | 10 |
|
11 | 11 | test('wait 500 ms', async () => {
|
12 |
| - const start = new Date() |
13 |
| - await wait(500) |
14 |
| - const end = new Date() |
15 |
| - var delta = Math.abs(end.getTime() - start.getTime()) |
16 |
| - expect(delta).toBeGreaterThan(450) |
17 |
| -}) |
| 12 | + const start = new Date(); |
| 13 | + await wait(500); |
| 14 | + const end = new Date(); |
| 15 | + var delta = Math.abs(end.getTime() - start.getTime()); |
| 16 | + expect(delta).toBeGreaterThan(450); |
| 17 | +}); |
18 | 18 |
|
19 | 19 | // shows how the runner will run a javascript action with env / stdout protocol
|
20 | 20 | test('test runs', () => {
|
21 |
| - process.env['INPUT_MILLISECONDS'] = '500' |
22 |
| - const ip = path.join(__dirname, '..', 'lib', 'main.js') |
| 21 | + process.env['INPUT_MILLISECONDS'] = '500'; |
| 22 | + const ip = path.join(__dirname, '..', 'lib', 'main.js'); |
23 | 23 | const options: cp.ExecSyncOptions = {
|
24 |
| - env: process.env |
25 |
| - } |
26 |
| - console.log(cp.execSync(`node ${ip}`, options).toString()) |
27 |
| -}) |
| 24 | + env: process.env, |
| 25 | + }; |
| 26 | + console.log(cp.execSync(`node ${ip}`, options).toString()); |
| 27 | +}); |
0 commit comments