test: Improved test cases

releases/v3
Tycho Bokdam 2020-12-14 23:11:38 +01:00
parent 9925916d8e
commit 609a140e1f
No known key found for this signature in database
GPG Key ID: A0FAE77C8CDF33C7
5 changed files with 15 additions and 15 deletions

View File

@ -106,7 +106,7 @@ jobs:
ENV: 'dont-use-git'
with:
github-token: ${{ secrets.github_token }}
pre-commit: test/pre-commit.js
pre-commit: './test-pre-commit.js'
skip-on-empty: 'false'
- run: test -f pre-commit.test.json || (echo should be here && exit 1)
@ -136,7 +136,7 @@ jobs:
ENV: 'dont-use-git'
with:
github-token: ${{ secrets.github_token }}
pre-changelog-generation: test/pre-changelog-generation.js
pre-changelog-generation: './test-pre-changelog-generation.js'
version-file: './test-file.toml'
version-path: 'package.version'
@ -359,7 +359,7 @@ jobs:
ENV: 'dont-use-git'
with:
github-token: ${{ secrets.github_token }}
version-file: './test/test-file-empty.toml'
version-file: './test-file-empty.toml'
version-path: 'package.version'
- name: Show file

View File

@ -3,4 +3,4 @@ title = "test"
# Comment
[package]
name = "test file"
version = "0.1.0"
version = "0.9.3"

View File

@ -1,5 +1,5 @@
package:
version: '0.1.0'
version: '9.4.5'
# Comment
different:

View File

@ -1,11 +1,11 @@
const fs = require('fs')
const t = require('assert')
const assert = require('assert')
exports.preVersionGeneration = (version) => {
const { GITHUB_WORKSPACE } = process.env
t.ok(GITHUB_WORKSPACE, 'GITHUB_WORKSPACE should not be empty')
t.ok(version, 'version should not be empty')
assert.ok(GITHUB_WORKSPACE, 'GITHUB_WORKSPACE should not be empty')
assert.ok(version, 'version should not be empty')
const newVersion = '1.0.100'
@ -17,9 +17,9 @@ exports.preVersionGeneration = (version) => {
exports.preTagGeneration = (tag) => {
const { GITHUB_WORKSPACE } = process.env
t.ok(GITHUB_WORKSPACE, 'GITHUB_WORKSPACE should not be empty')
t.ok(tag, 'tag should not be empty')
t.strictEqual(tag, 'v1.0.100')
assert.ok(GITHUB_WORKSPACE, 'GITHUB_WORKSPACE should not be empty')
assert.ok(tag, 'tag should not be empty')
assert.strictEqual(tag, 'v1.0.100')
const newTag = 'v1.0.100-alpha'

View File

@ -1,12 +1,12 @@
const fs = require('fs')
const t = require('assert')
const assert = require('assert')
exports.preCommit = (props) => {
const {GITHUB_WORKSPACE} = process.env;
t.ok(GITHUB_WORKSPACE, 'GITHUB_WORKSPACE should not be empty')
t.ok(props.tag, 'tag should not be empty')
t.ok(props.version, 'version should not be empty')
assert.ok(GITHUB_WORKSPACE, 'GITHUB_WORKSPACE should not be empty')
assert.ok(props.tag, 'tag should not be empty')
assert.ok(props.version, 'version should not be empty')
const body = {
workspace: GITHUB_WORKSPACE,