Cleanup of the template

This commit is contained in:
Michal Dorner 2020-10-01 23:35:59 +02:00
parent c4979203f6
commit e09b207f38
No known key found for this signature in database
GPG key ID: 9EEE04B48DA36786
13 changed files with 1409 additions and 1532 deletions

View file

@ -1,27 +1,3 @@
import {wait} from '../src/wait'
import * as process from 'process'
import * as cp from 'child_process'
import * as path from 'path'
test('throws invalid number', async () => {
const input = parseInt('foo', 10)
await expect(wait(input)).rejects.toThrow('milliseconds not a number')
})
test('wait 500 ms', async () => {
const start = new Date()
await wait(500)
const end = new Date()
var delta = Math.abs(end.getTime() - start.getTime())
expect(delta).toBeGreaterThan(450)
})
// shows how the runner will run a javascript action with env / stdout protocol
test('test runs', () => {
process.env['INPUT_MILLISECONDS'] = '500'
const ip = path.join(__dirname, '..', 'lib', 'main.js')
const options: cp.ExecSyncOptions = {
env: process.env
}
console.log(cp.execSync(`node ${ip}`, options).toString())
test('TODO', async () => {
await expect(true).toBeTruthy()
})