- configure test case
This commit is contained in:
+40
-14
@@ -2,26 +2,52 @@ 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)
|
||||
})
|
||||
import { ReleaseNotes } from '../src/releaseNotes';
|
||||
import { readConfiguration } from '../src/utils';
|
||||
import { createCommandManager } from '../src/git-helper';
|
||||
import * as core from '@actions/core';
|
||||
import { Tags } from '../src/tags';
|
||||
|
||||
// shows how the runner will run a javascript action with env / stdout protocol
|
||||
/*
|
||||
test('test runs', () => {
|
||||
process.env['INPUT_MILLISECONDS'] = '500'
|
||||
jest.setTimeout(180000);
|
||||
|
||||
process.env['INPUT_CONFIGURATION'] = 'configuration.json'
|
||||
const ip = path.join(__dirname, '..', 'lib', 'main.js')
|
||||
const options: cp.ExecSyncOptions = {
|
||||
env: process.env
|
||||
}
|
||||
console.log(cp.execSync(`node ${ip}`, options).toString())
|
||||
})
|
||||
*/
|
||||
|
||||
it("Should be true", async () => {
|
||||
jest.setTimeout(180000);
|
||||
|
||||
const configuration = readConfiguration('configuration.json')
|
||||
const releaseNotes = new ReleaseNotes({
|
||||
owner: "mikepenz",
|
||||
repo: "MaterialDrawer",
|
||||
fromTag: null,
|
||||
toTag: "v8.1.6",
|
||||
configuration: configuration
|
||||
})
|
||||
|
||||
|
||||
const changeLog = await releaseNotes.pull()
|
||||
console.log(changeLog)
|
||||
expect(changeLog).toStrictEqual(`
|
||||
|
||||
<details>
|
||||
<summary>Uncategorized</summary>
|
||||
|
||||
- Improve GitHub Actions
|
||||
- PR: #2655
|
||||
- Update dependencies
|
||||
- PR: #2656
|
||||
- [RELEASE] v8.1.6
|
||||
- PR: #2657
|
||||
|
||||
</details>`)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user