Skip to content
This repository has been archived by the owner on Oct 17, 2023. It is now read-only.

Commit

Permalink
Feature/fetch commit files (#11)
Browse files Browse the repository at this point in the history
Co-authored-by: yusuferdem <[email protected]>
  • Loading branch information
suleymanbarman and yusuf-erdem authored Jul 18, 2023
1 parent f02369b commit 64877a2
Show file tree
Hide file tree
Showing 10 changed files with 26,057 additions and 3,363 deletions.
28 changes: 2 additions & 26 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,5 @@
import {wait} from '../src/wait'
import * as process from 'process'
import * as cp from 'child_process'
import * as path from 'path'
import {expect, test} from '@jest/globals'
import {test} from '@jest/globals'

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 np = process.execPath
const ip = path.join(__dirname, '..', 'lib', 'main.js')
const options: cp.ExecFileSyncOptions = {
env: process.env
}
console.log(cp.execFileSync(np, [ip], options).toString())
console.log("tests")
})
15 changes: 8 additions & 7 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: 'Your name here'
description: 'Provide a description here'
author: 'Your name or organization here'
name: 'CP Test Wiser'
description: 'Action for detecting file changes according to commit'
author: 'Yusuf Erdem [email protected]'
inputs:
milliseconds: # change this
github-token:
description:
GitHub token for GitHub API requests.
required: true
description: 'input description here'
default: 'default value if applicable'
default: ${{ github.token }}
runs:
using: 'node16'
main: 'dist/index.js'
main: 'dist/index.js'
Loading

0 comments on commit 64877a2

Please sign in to comment.