From 9fe23b283cc08bb3608fa3328b8a59da90f40dc4 Mon Sep 17 00:00:00 2001 From: KonghaYao <20192831006@m.scnu.edu.cn> Date: Fri, 30 Jul 2021 20:45:59 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E9=A2=84=E8=AE=A1=E5=B0=86=20Mobx=20?= =?UTF-8?q?=E4=BD=9C=E4=B8=BA=20Mirror=20=E7=9A=84=E5=9F=BA=E7=A1=80?= =?UTF-8?q?=E6=A1=86=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 5 +- .prettierrc | 13 +-- FakeServer/ajax/fetch/fetch.js | 4 +- FakeServer/package.json | 2 +- docs/_sidebar.md | 5 + index.html | 176 +++++++++++++++++---------------- test/modules.json | 24 +++++ test/test-redux.js | 3 + test/test.bat | 1 + test/test.js | 13 +-- 10 files changed, 137 insertions(+), 109 deletions(-) create mode 100644 docs/_sidebar.md create mode 100644 test/modules.json create mode 100644 test/test-redux.js create mode 100644 test/test.bat diff --git a/.eslintrc.js b/.eslintrc.js index 98dfefe..9560826 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -9,9 +9,12 @@ module.exports = { extends: ['eslint:recommended', 'prettier', 'google'], parser: '@babel/eslint-parser', parserOptions: { - ecmaVersion: 12, + ecmaVersion: latest, sourceType: 'module', requireConfigFile: false, + ecmaFeatures: { + experimentalDecorators: true, + }, }, globals: { __version__: true, diff --git a/.prettierrc b/.prettierrc index 83df7f6..92ae940 100644 --- a/.prettierrc +++ b/.prettierrc @@ -6,16 +6,5 @@ "singleQuote": true, "semi": true, "trailingComma": "all", - "bracketSpacing": true, - "overrides": [ - { - "files": [ - "FakeServer/**/*.{ts,json,md,yml,js}", - "plugins/**/*.{ts,json,md,yml,js}", - "src/**/*.{ts,json,md,yml,js}", - "tools/**/*.{ts,json,md,yml,js}", - "docs/**/*.{md}" - ] - } - ] + "bracketSpacing": true } diff --git a/FakeServer/ajax/fetch/fetch.js b/FakeServer/ajax/fetch/fetch.js index 8304c0c..40b9f2c 100644 --- a/FakeServer/ajax/fetch/fetch.js +++ b/FakeServer/ajax/fetch/fetch.js @@ -11,8 +11,8 @@ async function fakeFetch(url, options = {}) { const result = await config.proxy(url, options); if (result) { if (!config.silent) console.warn('fetch: mock代理中'); - const { body, options = {} } = result; - return new fakeResponse(body, options); + const { body, headers } = result; + return new fakeResponse(body, { headers }); } } diff --git a/FakeServer/package.json b/FakeServer/package.json index c1b7e4d..f66d6e1 100644 --- a/FakeServer/package.json +++ b/FakeServer/package.json @@ -1,6 +1,6 @@ { "name": "@konghayao/fake-server", - "version": "0.0.2", + "version": "0.1.0", "description": "", "main": "dist/index.js", "scripts": { diff --git a/docs/_sidebar.md b/docs/_sidebar.md new file mode 100644 index 0000000..4c74161 --- /dev/null +++ b/docs/_sidebar.md @@ -0,0 +1,5 @@ +- [JSpider 介绍]() +- [JSpider 教程]() +- [JSpider 使用]() +- [JSpider 理解]() +- [JSpider FAQ]() diff --git a/index.html b/index.html index 72c3987..d9d7c69 100644 --- a/index.html +++ b/index.html @@ -1,103 +1,109 @@ - - - JSpider 3 - - - - - - - - - - -
- + + + JSpider 3 + + + + + + + + - - + + + }, + plugins: [ + ], + }; + - + - - + + - - + + - - - - + + + + + - diff --git a/test/modules.json b/test/modules.json new file mode 100644 index 0000000..893e80c --- /dev/null +++ b/test/modules.json @@ -0,0 +1,24 @@ +{ + "imports": { + "mobx": "https://ga.jspm.io/npm:mobx@6.3.2/dist/mobx.esm.js", + "lodash": "https://ga.jspm.io/npm:lodash@4.17.21/lodash.js", + "mitt": "https://ga.jspm.io/npm:mitt@3.0.0/dist/mitt.mjs", + "redux": "https://ga.jspm.io/npm:redux@4.1.0/lib/dev.redux.js", + "rxjs": "https://ga.jspm.io/npm:rxjs@6.6.6/index.js", + "rxjs/operators": "https://ga.jspm.io/npm:rxjs@6.6.6/operators/index.js", + "redux-saga": "https://ga.jspm.io/npm:redux-saga@1.1.3/dist/redux-saga-core-npm-proxy.cjs.js", + "redux-thunk": "https://ga.jspm.io/npm:redux-thunk@2.3.0/lib/index.js" + }, + "scopes": { + "https://ga.jspm.io/": { + "@babel/runtime/helpers/extends": "https://ga.jspm.io/npm:@babel/runtime@7.14.8/helpers/extends.js", + "@babel/runtime/helpers/objectSpread2": "https://ga.jspm.io/npm:@babel/runtime@7.14.8/helpers/objectSpread2.js", + "@babel/runtime/helpers/objectWithoutPropertiesLoose": "https://ga.jspm.io/npm:@babel/runtime@7.14.8/helpers/objectWithoutPropertiesLoose.js", + "@redux-saga/core": "https://ga.jspm.io/npm:@redux-saga/core@1.1.3/dist/dev.redux-saga-core.cjs.js", + "@redux-saga/deferred": "https://ga.jspm.io/npm:@redux-saga/deferred@1.1.2/dist/redux-saga-deferred.cjs.js", + "@redux-saga/delay-p": "https://ga.jspm.io/npm:@redux-saga/delay-p@1.1.2/dist/redux-saga-delay-p.cjs.js", + "@redux-saga/is": "https://ga.jspm.io/npm:@redux-saga/is@1.1.2/dist/redux-saga-is.cjs.js", + "@redux-saga/symbols": "https://ga.jspm.io/npm:@redux-saga/symbols@1.1.2/dist/redux-saga-symbols.cjs.js" + } + } +} diff --git a/test/test-redux.js b/test/test-redux.js new file mode 100644 index 0000000..283e09c --- /dev/null +++ b/test/test-redux.js @@ -0,0 +1,3 @@ +class a { + @getFunc a = 2; +} diff --git a/test/test.bat b/test/test.bat new file mode 100644 index 0000000..4d90f90 --- /dev/null +++ b/test/test.bat @@ -0,0 +1 @@ +deno run --import-map modules.json -A ./test.js diff --git a/test/test.js b/test/test.js index 2ee43c6..8c07cfd 100644 --- a/test/test.js +++ b/test/test.js @@ -1,9 +1,7 @@ -const mitt = require('mitt'); -const { EMPTY, iif, of, from, pipe, fromEventPattern, timer, interval, Observable } = require('rxjs'); -const { Subscription } = require('rxjs'); - -const { noop } = require('rxjs'); -const { +// 使用 deno 测试一些 rxjs 相关的东西 +import mitt from 'mitt'; +import { EMPTY, iif, of, from, pipe, fromEventPattern, timer, interval, Observable, noop, Subscription } from 'rxjs'; +import { map, switchMap, mergeAll, @@ -24,8 +22,7 @@ const { takeUntil, switchMapTo, exhaustMap, - concat, -} = require('rxjs/operators'); +} from 'rxjs/operators'; const emitter = mitt(); const pause$ = fromEventPattern((handle) => emitter.on('pause', handle));