-
Notifications
You must be signed in to change notification settings - Fork 352
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Node File System Persister (#61)
+ Node testing & ESLint + Ember testem integrations
- Loading branch information
1 parent
29ed8e1
commit 0a0eeca
Showing
41 changed files
with
1,796 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import deepmerge from 'deepmerge'; | ||
import multiEntry from 'rollup-plugin-multi-entry'; | ||
import createNodeConfig from './rollup.node.config'; | ||
import { pkg } from './rollup.utils'; | ||
|
||
export default function createNodeTestConfig(options = {}) { | ||
return deepmerge( | ||
createNodeConfig({ | ||
input: 'tests/!(browser)/**/*-test.js', | ||
output: { | ||
format: 'cjs', | ||
name: `${pkg.name}-tests`, | ||
file: `./build/node/test-bundle.cjs.js`, | ||
intro: `describe('${pkg.name}', function() {`, | ||
outro: '});' | ||
}, | ||
plugins: [multiEntry()], | ||
external: ['chai'] | ||
}), | ||
options | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# REST Persister | ||
|
||
Read and write recordings to and from the file system. | ||
|
||
## Installation | ||
|
||
_Note that you must have node (and npm) installed._ | ||
|
||
```bash | ||
npm install @pollyjs/persister-fs -D | ||
``` | ||
|
||
If you want to install it with [yarn](https://yarnpkg.com): | ||
|
||
```bash | ||
yarn add @pollyjs/persister-fs -D | ||
``` | ||
|
||
## Usage | ||
|
||
```js | ||
import { Polly } from '@pollyjs/core'; | ||
import FSPersister from '@pollyjs/persister-fs'; | ||
|
||
new Polly('<Recording Name>', { | ||
persister: ['fs', FSPersister] | ||
}); | ||
``` | ||
|
||
## Options | ||
|
||
### recordingsDir | ||
|
||
_Type_: `String` | ||
_Default_: `'recordings'` | ||
|
||
The root directory to store all recordings. Supports both relative and | ||
absolute paths. | ||
|
||
__Example__ | ||
|
||
```js | ||
polly.configure({ | ||
persisterOptions: { | ||
fs: { | ||
recordingsDir: '__recordings__' | ||
} | ||
} | ||
}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import createClientTestConfig from '../../../build-scripts/rollup.browser.test.config'; | ||
import createNodeTestConfig from '../../../build-scripts/rollup.node.test.config'; | ||
import createBrowserTestConfig from '../../../build-scripts/rollup.browser.test.config'; | ||
|
||
export default createClientTestConfig(); | ||
export default [createNodeTestConfig(), createBrowserTestConfig()]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import createClientTestConfig from '../../../build-scripts/rollup.browser.test.config'; | ||
import createNodeTestConfig from '../../../build-scripts/rollup.node.test.config'; | ||
import createBrowserTestConfig from '../../../build-scripts/rollup.browser.test.config'; | ||
|
||
export default createClientTestConfig(); | ||
export default [createNodeTestConfig(), createBrowserTestConfig()]; |
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...pollyjs/core/tests/helpers/xhr-request.js → ...core/tests/browser/helpers/xhr-request.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...s/core/tests/integration/adapters-test.js → ...ests/browser/integration/adapters-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...core/tests/integration/persisters-test.js → ...ts/browser/integration/persisters-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...yjs/core/tests/integration/server-test.js → .../tests/browser/integration/server-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...unit/utils/serialize-request-body-test.js → ...unit/utils/serialize-request-body-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.