Skip to content

Commit

Permalink
Merge pull request #1 from form8ion/alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
travi authored Jun 27, 2020
2 parents b871baf + dc23c0f commit 518905e
Show file tree
Hide file tree
Showing 12 changed files with 4,426 additions and 1,422 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/jest'

overrides:
- files: example.js
rules:
import/no-extraneous-dependencies: off
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ opinionated scaffolder for [Jest](https://jestjs.io)

* [Usage](#usage)
* [Installation](#installation)
* [Features](#features)
* [Example](#example)
* [Import](#import)
* [Execute](#execute)
* [Contributing](#contributing)
* [Dependencies](#dependencies)
* [Verification](#verification)
Expand All @@ -33,10 +36,26 @@ opinionated scaffolder for [Jest](https://jestjs.io)
$ npm install @form8ion/jest-scaffolder --save-prod
```

### Features

* Includes [jest-when](https://www.npmjs.com/package/jest-when) since the mocks
built into [Jest](https://jestjs.io) [do not enable conditional returns](https://github.com/facebook/jest/issues/6180)
and can encourage behavior that relies on side effects

### Example

#### Import

```javascript
import {scaffold} from '@form8ion/jest-scaffolder';
```

#### Execute

```javascript
import jestScaffolder from '@form8ion/jest-scaffolder';
(async function example() {
await scaffold({projectRoot: process.cwd()});
}());
```

## Contributing
Expand Down
14 changes: 12 additions & 2 deletions example.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
// #### Import
// remark-usage-ignore-next
/* eslint-disable-next-line no-unused-vars */
import jestScaffolder from './lib/index.cjs';
import stubbedFs from 'mock-fs';
import {scaffold} from './lib/index.cjs';

// remark-usage-ignore-next
stubbedFs();

// #### Execute

(async function example() {
await scaffold({projectRoot: process.cwd()});
}());
Loading

0 comments on commit 518905e

Please sign in to comment.