Skip to content

Commit 2f8b3d0

Browse files
committed
Revert "feat(predicate): leverage implementation from the core package"
This reverts commit fdb4643.
1 parent 5a865fc commit 2f8b3d0

5 files changed

Lines changed: 31 additions & 13 deletions

File tree

package-lock.json

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

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
"packageManager": "npm@11.3.0+sha512.96eb611483f49c55f7fa74df61b588de9e213f80a256728e6798ddc67176c7b07e4a1cfc7de8922422cbce02543714367037536955221fa451b0c4fefaf20c66",
5858
"dependencies": {
5959
"@form8ion/core": "^4.6.1",
60-
"@form8ion/github-core": "^1.0.0-alpha.1",
6160
"@form8ion/repository-settings": "^1.1.4",
6261
"@octokit/rest": "^21.0.0",
6362
"@travi/cli-messages": "^1.1.1",

src/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
export {sourceHostedOnGitHub as test} from '@form8ion/github-core';
2-
31
export {constants as promptConstants} from './prompt/index.js';
42
export {default as scaffold} from './scaffolder.js';
3+
export {default as test} from './tester.js';
54
export {default as lift} from './lifter.js';

src/tester.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import {directoryExists} from '@form8ion/core';
2+
3+
export default function ({projectRoot}) {
4+
return directoryExists(`${projectRoot}/.github`);
5+
}

src/tester.test.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import {directoryExists} from '@form8ion/core';
2+
3+
import any from '@travi/any';
4+
import {when} from 'vitest-when';
5+
import {describe, expect, it, vi} from 'vitest';
6+
7+
import projectIsVersionedOnGithub from './tester.js';
8+
9+
vi.mock('@form8ion/core');
10+
11+
describe('github predicate', () => {
12+
const projectRoot = any.string();
13+
14+
it('should return `true` when the `.github` directory is present', async () => {
15+
when(directoryExists).calledWith(`${projectRoot}/.github`).thenResolve(true);
16+
17+
expect(await projectIsVersionedOnGithub({projectRoot})).toBe(true);
18+
});
19+
20+
it('should return `false` when the `.github` directory is not present', async () => {
21+
when(directoryExists).calledWith(`${projectRoot}/.github`).thenResolve(false);
22+
23+
expect(await projectIsVersionedOnGithub({projectRoot})).toBe(false);
24+
});
25+
});

0 commit comments

Comments
 (0)