Skip to content

Commit e670e46

Browse files
committed
feat(workflow-file): leveraged the workflows-core existence checker
1 parent d391f04 commit e670e46

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
},
5555
"dependencies": {
5656
"@form8ion/core": "^4.0.0",
57-
"@form8ion/github-workflows-core": "^5.2.0",
57+
"@form8ion/github-workflows-core": "^5.3.0",
5858
"@form8ion/javascript-core": "^11.0.0",
5959
"semver": "^7.3.7"
6060
},

src/lifter/tester.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import {fileExists} from '@form8ion/core';
1+
import {workflowFileExists} from '@form8ion/github-workflows-core';
22

33
export default function ({projectRoot}) {
4-
return fileExists(`${projectRoot}/.github/workflows/node-ci.yml`);
4+
return workflowFileExists({projectRoot, name: 'node-ci'});
55
}

src/lifter/tester.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import {fileExists} from '@form8ion/core';
1+
import {workflowFileExists} from '@form8ion/github-workflows-core';
22

33
import {afterEach, describe, it, vi, expect} from 'vitest';
44
import any from '@travi/any';
55
import {when} from 'jest-when';
66

77
import testThatCiWorkflowExists from './tester.js';
88

9-
vi.mock('@form8ion/core');
9+
vi.mock('@form8ion/github-workflows-core');
1010

1111
describe('predicate', () => {
1212
const projectRoot = any.string();
@@ -16,13 +16,13 @@ describe('predicate', () => {
1616
});
1717

1818
it('should return `false` when no ci workflow file exists', async () => {
19-
fileExists.mockResolvedValue(false);
19+
workflowFileExists.mockResolvedValue(false);
2020

2121
expect(await testThatCiWorkflowExists({projectRoot})).toBe(false);
2222
});
2323

2424
it('should return `true` when a ci workflow file exists', async () => {
25-
when(fileExists).calledWith(`${projectRoot}/.github/workflows/node-ci.yml`).mockResolvedValue(true);
25+
when(workflowFileExists).calledWith({projectRoot, name: 'node-ci'}).mockResolvedValue(true);
2626

2727
expect(await testThatCiWorkflowExists({projectRoot})).toBe(true);
2828
});

0 commit comments

Comments
 (0)