Skip to content
This repository has been archived by the owner on Dec 18, 2021. It is now read-only.

Commit

Permalink
feat(test): exposed the test function
Browse files Browse the repository at this point in the history
  • Loading branch information
travi committed Apr 24, 2020
1 parent 590ac8c commit f193d5e
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 5 deletions.
7 changes: 6 additions & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
extends:
- '@form8ion'
- '@form8ion/mocha'
- '@form8ion/mocha'

overrides:
- files: example.js
rules:
import/no-extraneous-dependencies: off
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,18 @@ $ npm install @form8ion/lift-javascript --save-prod

### Example

#### Import

```javascript
import {lift} from '@form8ion/lift-javascript';
import {lift, test} from '@form8ion/lift-javascript';
```

lift({results: {dependencies: [], devDependencies: [], scripts: {}, elintConfigs: []}});
#### Execute

```javascript
if (test({projectRoot: process.cwd()})) {
lift({results: {dependencies: [], devDependencies: [], scripts: {}, elintConfigs: []}});
}
```

## Contributing
Expand Down
16 changes: 14 additions & 2 deletions example.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
import {lift} from './lib/index.cjs';
// #### Import
// remark-usage-ignore-next
import stubbedFs from 'mock-fs';
import {lift, test} from './lib/index.cjs';

lift({results: {dependencies: [], devDependencies: [], scripts: {}, elintConfigs: []}});
// remark-usage-ignore-next
stubbedFs();

// #### Execute

if (test({projectRoot: process.cwd()})) {
lift({results: {dependencies: [], devDependencies: [], scripts: {}, elintConfigs: []}});
}
// remark-usage-ignore-next
stubbedFs.restore();
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"husky": "4.2.5",
"lockfile-lint": "4.2.2",
"mocha": "7.1.1",
"mock-fs": "^4.12.0",
"npm-run-all": "4.1.5",
"nyc": "15.0.1",
"remark-cli": "8.0.0",
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export {default as lift} from './lift';
export {default as test} from './test';
11 changes: 11 additions & 0 deletions src/test-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import testApplicability from './test';

suite('applicability test', () => {
test('that `true` is returned if the project has an `.nvmrc` file', async () => {
await testApplicability();
});

test('that `false` is returned if the project does not have an `.nvmrc` file', async () => {

});
});
3 changes: 3 additions & 0 deletions src/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function () {

}

0 comments on commit f193d5e

Please sign in to comment.