Skip to content

Commit

Permalink
Update dependencies and defaults (#216)
Browse files Browse the repository at this point in the history
* Update jest and remove jest-circus dependency

* Update to newer typescript-action defaults
  • Loading branch information
workflow authored Mar 18, 2022
1 parent 7051939 commit 6494c88
Show file tree
Hide file tree
Showing 11 changed files with 4,894 additions and 10,668 deletions.
23 changes: 13 additions & 10 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import {wait} from '../src/wait'
import * as process from 'process'
import * as cp from 'child_process'
import * as path from 'path'

// 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', () => {})
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)
})
Loading

0 comments on commit 6494c88

Please sign in to comment.