Skip to content

Commit 66cd073

Browse files
committed
feat: made the tool callable
and started to wire up the husky check
1 parent b33c0ca commit 66cd073

File tree

6 files changed

+43
-11
lines changed

6 files changed

+43
-11
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ $ npm install @form8ion/ski-patrol --save-dev
3636
### Example
3737

3838
```javascript
39-
import skiPatrol from '@form8ion/ski-patrol';
39+
import {assess} from '@form8ion/ski-patrol';
40+
41+
(async () => {
42+
await assess();
43+
})();
4044
```
4145

4246
## Contributing

example.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
// remark-usage-ignore-next
2-
/* eslint-disable-next-line no-unused-vars */
3-
import skiPatrol from './lib/index.cjs';
1+
import {patrol} from './lib/index.cjs';
2+
3+
(async () => {
4+
await patrol({projectRoot: process.cwd()});
5+
})();

src/canary-test.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/husky.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default function () {
2+
3+
}

src/ski-patrol-test.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import {assert} from 'chai';
2+
import sinon from 'sinon';
3+
import any from '@travi/any';
4+
import * as husky from './husky';
5+
import {patrol} from './ski-patrol';
6+
7+
suite('ski-patrol', () => {
8+
let sandbox;
9+
10+
setup(() => {
11+
sandbox = sinon.createSandbox();
12+
13+
sandbox.stub(husky, 'default');
14+
});
15+
16+
teardown(() => sandbox.restore());
17+
18+
test('that the project is checked for issues', async () => {
19+
const projectRoot = any.string();
20+
21+
await patrol({projectRoot});
22+
23+
assert.calledWith(husky.default, projectRoot);
24+
});
25+
});

src/ski-patrol.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import husky from './husky';
2+
3+
export async function patrol({projectRoot}) {
4+
await husky(projectRoot);
5+
}

0 commit comments

Comments
 (0)