Skip to content

Commit

Permalink
Merge pull request #17 from morgan557/v2.0.0
Browse files Browse the repository at this point in the history
initial Revamp for version 2.0
  • Loading branch information
olivierodo authored Sep 2, 2021
2 parents 16f15b2 + b1deed8 commit 0ceb1a2
Show file tree
Hide file tree
Showing 14 changed files with 715 additions and 104 deletions.
4 changes: 3 additions & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ env:
browser: true
commonjs: true
es2021: true
node: true
parserOptions:
ecmaVersion: 12
rules: {}
rules:
no-done-callback: off
extends:
- eslint:recommended
- plugin:jest/style
Expand Down
14 changes: 10 additions & 4 deletions jest.setup.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
const { setupServer } = require('msw/node')
const { rest } = require('msw')

const status = {
'https://github.com/nodejs/undici': 204
const status = {
'https://github.com': 200,
'https://gitlab.com': 201,
'https://bitbucket.com': 204,
'https://broken.com/test': 404,
'https://broken.com': 403,
'https://gittlab.com': 500,
'https://ggithub.com': 401
}

const endpoints = Object.entries(status)
.map(([url, statusCode]) => rest.get(url, (req, res, ctx) => res(ctx.status(statusCode))))
.map(([url, statusCode]) => rest.get(url, (req, res, ctx) => res(ctx.status(statusCode))))

global.mockRemoteServer = setupServer(...endpoints)
global.mockRemoteServer = setupServer(...endpoints)
Loading

0 comments on commit 0ceb1a2

Please sign in to comment.