feat: create stage

This commit is contained in:
wancat committed 2024-03-08 00:38:49 +08:00
1 parent 65ad72223b
commit 77fe2d37b3
11 files changed
+67 -18

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
import { test, expect } from '@jest/globals'
import { Stage } from '../src/Stage'
test('check stage condition', () => {
const stage = new Stage({
id: 'stage1',
name: 'List the files using `ls`',
condition: {
command: 'ls',
pwd: '/home/user',
},
})
expect(
stage.satisfies({
command: 'ls',
pwd: '/home/user',
})
).toBe(true)
expect(
stage.satisfies({
command: 'ls',
pwd: '/home/user/Downloads',
})
).toBe(false)
})