File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { wait } from '../src/wait'
2- import * as process from 'process'
3- import * as cp from 'child_process'
4- import * as path from 'path'
5-
62test ( 'throws invalid number' , async ( ) => {
73 const input = parseInt ( 'foo' , 10 )
84 await expect ( wait ( input ) ) . rejects . toThrow ( 'milliseconds not a number' )
95} )
10-
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- } )
18-
19- // shows how the runner will run a javascript action with env / stdout protocol
20- test ( 'test runs' , ( ) => {
21- process . env [ 'INPUT_MILLISECONDS' ] = '500'
22- const ip = path . join ( __dirname , '..' , 'lib' , 'main.js' )
23- const options : cp . ExecSyncOptions = {
24- env : process . env
25- }
26- console . log ( cp . execSync ( `node ${ ip } ` , options ) . toString ( ) )
27- } )
Original file line number Diff line number Diff line change 11import GithubAPIClient from './services/github/GithubAPIClient'
22import * as core from '@actions/core'
33async function run ( ) : Promise < void > {
4- core . debug (
5- JSON . stringify (
6- await GithubAPIClient . getCollaboratorsNames ( {
7- name : 'api_pt' ,
8- owner : 'warrenbrasil'
9- } )
4+ try {
5+ core . debug (
6+ JSON . stringify (
7+ await GithubAPIClient . getCollaboratorsNames ( {
8+ name : 'api_pt' ,
9+ owner : 'warrenbrasil'
10+ } )
11+ )
1012 )
11- )
12- return
13+ } catch ( e ) {
14+ throw e
15+ }
1316}
1417
1518run ( )
You can’t perform that action at this time.
0 commit comments