-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2449c35
commit f26a0a2
Showing
16 changed files
with
39,517 additions
and
313 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"json.schemas": [ | ||
{ | ||
"fileMatch": ["test/oas/fixtures/*.json"], | ||
"url": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/f1adc846131b33be72df6a0c87e5e5da59dde0ff/schemas/v3.0/schema.json" | ||
} | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 @@ | ||
- [ ] Export `cleanUrl` function from MSW. |
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,25 +1,47 @@ | ||
# Library name | ||
# `@mswjs/source` | ||
|
||
> A short description about what your library is. | ||
## Install | ||
|
||
## Motivation | ||
```sh | ||
$ npm install @mswjs/source -D | ||
# or | ||
$ yarn add @mswjs/source -D | ||
``` | ||
|
||
## Sources | ||
|
||
### Browser traffic (HAR) | ||
|
||
> Elaborate on the reason behind this library: why may people need it? What issues does it solve? How is it different from the similar libraries? | ||
```js | ||
import { fromTraffic } from '@mswjs/source' | ||
import traffic from './github.com.har' | ||
|
||
## Getting started | ||
export const handlers = fromTraffic(traffic) | ||
``` | ||
|
||
### Test runtime | ||
|
||
> Go through the steps necessary to install, configure, and use your library. | ||
```js | ||
// jest.setup.js | ||
import { setupServer } from 'msw/node' | ||
import { fromRuntime } from '@mswjs/source' | ||
|
||
### Install | ||
const server = setupServer() | ||
|
||
```bash | ||
$ npm install <LIBRARY_NAME> | ||
beforeAll(() => { | ||
server.listen() | ||
fromRuntime(server) | ||
}) | ||
``` | ||
|
||
## Documentation | ||
### OpenAPI (Swagger) | ||
|
||
> Reference the documentation website, or write the documentation straight in this README file. | ||
- Explain what spec properties are used as mocked responses. | ||
|
||
## Contributing | ||
```js | ||
import { fromOpenApi } from '@mswjs/source' | ||
import apiDocument from 'api.spec.json' | ||
|
||
Please read the [Contribution guidelines](CONTRIBUTING.md) to start with your awesome contributions! | ||
const apiDocument = fs.readFileSync('spec.json') | ||
export const handlers = fromOpenApi(apiDocument) | ||
``` |
This file was deleted.
Oops, something went wrong.
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 +1 @@ | ||
export { fromOpenAPI } from './oas/fromOpenAPI' | ||
export { fromOpenApi } from './oas/fromOpenApi' |
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.