Skip to content

Commit

Permalink
feat(packages/sui-mock): update ts
Browse files Browse the repository at this point in the history
  • Loading branch information
kikoruiz committed Jun 21, 2023
1 parent 09bd269 commit 02b493b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
6 changes: 3 additions & 3 deletions packages/sui-mock/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@s-ui/mock",
"version": "1.2.0",
"version": "1.3.0-beta.2",
"main": "lib/index.js",
"description": "mock provider",
"types": "lib/index",
"scripts": {
"lib": "babel --presets sui ./src --out-dir ./lib",
"prepublishOnly": "npm run lib",
"test": "npm run test:client && npm run test:server",
"test": "npm run test:browser && npm run test:server",
"test:browser": "npx @s-ui/test browser -P './test/browser/**/*Spec.js'",
"test:browser:watch": "npm run test:client -- --watch",
"test:server": "npx @s-ui/test server -P './test/server/**/*Spec.js'",
Expand All @@ -17,7 +17,7 @@
"author": "",
"license": "MIT",
"dependencies": {
"msw": "0.47.4"
"msw": "1.2.1"
},
"repository": {
"type": "git",
Expand Down
9 changes: 7 additions & 2 deletions packages/sui-mock/src/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ export const getBrowserMocker = async (handlers = []) => {
const worker = setup(...handlers)

return {
...worker,
start: worker.start,
stop: worker.stop,
listen: worker.start,
close: worker.stop
close: worker.stop,
use: worker.use,
resetHandlers: worker.resetHandlers,
restoreHandlers: worker.restoreHandlers,
printHandlers: worker.printHandlers
}
}
11 changes: 8 additions & 3 deletions packages/sui-mock/src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ export const getServerMocker = async (handlers = []) => {
const worker = setupServer(...handlers)

return {
...worker,
start: worker.listen,
stop: worker.close
start: worker.start,
stop: worker.stop,
listen: worker.start,
close: worker.stop,
use: worker.use,
resetHandlers: worker.resetHandlers,
restoreHandlers: worker.restoreHandlers,
printHandlers: worker.printHandlers
}
}

0 comments on commit 02b493b

Please sign in to comment.