Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

集成 CommandPalette 和 ThemePalette #75

Merged
merged 11 commits into from
Mar 11, 2021
Prev Previous commit
test: mock canvas and monacoService
  • Loading branch information
wewoor committed Mar 11, 2021
commit 12f9d41d2f46fa5eacfd7ddb21599cc68e4c51a6
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = {
'\\.(css|scss|less)$': '<rootDir>/mock/styleMock.js',
'^mo/(.*)$': '<rootDir>/src/$1',
'^mo$': '<rootDir>/src/index.ts',
// '^monaco-editor(.*)$': '<rootDir>/mock/monacoMock.jsx',
'^monaco-editor$': '<rootDir>/mock/monacoMock.js',
},
setupFiles: ['jest-canvas-mock', './test/setupTests.ts'],
};
2 changes: 2 additions & 0 deletions mock/monacoMock.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ module.exports = {
setTheme: function (theme) {},
create: function (dom, options, override) {},
},
KeyMod: {},
KeyCode: {},
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"extract-loader": "^5.1.0",
"husky": "^4.3.0",
"jest": "^26.0.1",
"jest-canvas-mock": "^2.3.1",
"monaco-editor-webpack-plugin": "^2.0.0",
"prettier": "^2.1.2",
"react-test-renderer": "^17.0.1",
Expand Down
5 changes: 5 additions & 0 deletions test/setupTests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
jest.mock('mo/monaco/monacoService', () => ({
monacoService: {
create: function (dom, options, override) {},
},
}));
22 changes: 21 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5160,7 +5160,7 @@ [email protected]:
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=

color-name@~1.1.4:
color-name@^1.1.4, color-name@~1.1.4:
version "1.1.4"
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
Expand Down Expand Up @@ -5773,6 +5773,11 @@ cssesc@^3.0.0:
resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee"
integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==

cssfontparser@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/cssfontparser/-/cssfontparser-1.2.1.tgz#f4022fc8f9700c68029d542084afbaf425a3f3e3"
integrity sha1-9AIvyPlwDGgCnVQghK+69CWj8+M=

cssom@^0.4.4:
version "0.4.4"
resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.4.4.tgz#5a66cf93d2d0b661d80bf6a44fb65f5c2e4e0a10"
Expand Down Expand Up @@ -8896,6 +8901,14 @@ jake@^10.6.1:
filelist "^1.0.1"
minimatch "^3.0.4"

jest-canvas-mock@^2.3.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/jest-canvas-mock/-/jest-canvas-mock-2.3.1.tgz#9535d14bc18ccf1493be36ac37dd349928387826"
integrity sha512-5FnSZPrX3Q2ZfsbYNE3wqKR3+XorN8qFzDzB5o0golWgt6EOX1+emBnpOc9IAQ+NXFj8Nzm3h7ZdE/9H0ylBcg==
dependencies:
cssfontparser "^1.2.1"
moo-color "^1.0.2"

jest-changed-files@^26.6.2:
version "26.6.2"
resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-26.6.2.tgz#f6198479e1cc66f22f9ae1e22acaa0b429c042d0"
Expand Down Expand Up @@ -10195,6 +10208,13 @@ monaco-editor@^0.21.2:
resolved "https://registry.yarnpkg.com/monaco-editor/-/monaco-editor-0.21.3.tgz#3381b66614b64d1c5e3b77dd5564ad496d1b4e5d"
integrity sha512-9N7wATLpi+googstvtm6IKg97vPQ77FDYEpkow5tLriM/VJ0DaTRyUP4UVzcoH7KlPDX+e/rE7/imcOUeGkT6g==

moo-color@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/moo-color/-/moo-color-1.0.2.tgz#837c40758d2d58763825d1359a84e330531eca64"
integrity sha512-5iXz5n9LWQzx/C2WesGFfpE6RLamzdHwsn3KpfzShwbfIqs7stnoEpaNErf/7+3mbxwZ4s8Foq7I0tPxw7BWHg==
dependencies:
color-name "^1.1.4"

move-concurrently@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/move-concurrently/-/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92"
Expand Down