Skip to content

Commit 2705e8d

Browse files
committed
test(unit): convert tests for release chain resolver to vitest
for #458
1 parent a3314f3 commit 2705e8d

File tree

2 files changed

+24
-27
lines changed

2 files changed

+24
-27
lines changed

src/semantic-release/ci-providers/github-workflows/release-trigger-needs-test.js

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import any from '@travi/any';
2+
import {it, expect, describe} from 'vitest';
3+
4+
import determineTriggerNeedsFrom from './release-trigger-needs.js';
5+
6+
describe('release-trigger needs', () => {
7+
it('should not list either job if neither `verify` nor `verify-matrix` are present in `jobs`', async () => {
8+
expect(determineTriggerNeedsFrom(any.objectWithKeys(any.listOf(any.word)))).toEqual([]);
9+
});
10+
11+
it('should should list `verify` if present in `jobs`', async () => {
12+
expect(determineTriggerNeedsFrom(any.objectWithKeys([...any.listOf(any.word), 'verify']))).toEqual(['verify']);
13+
});
14+
15+
it('should list `verify-matrix` if present in `jobs`', async () => {
16+
expect(determineTriggerNeedsFrom(any.objectWithKeys([...any.listOf(any.word), 'verify-matrix'])))
17+
.toEqual(['verify-matrix']);
18+
});
19+
20+
it('should list `verify` and `verify-matrix` if both are listed in `jobs`', async () => {
21+
expect(determineTriggerNeedsFrom(any.objectWithKeys(['verify', ...any.listOf(any.word), 'verify-matrix'])))
22+
.toEqual(['verify', 'verify-matrix']);
23+
});
24+
});

0 commit comments

Comments
 (0)