|
4 | 4 | "private": false, |
5 | 5 | "description": "Enhanced Monaco editor with TextMate grammars and more", |
6 | 6 | "scripts": { |
7 | | - "build": "rollup --config rollup.config.ts --configPlugin typescript && npm run generate-types", |
| 7 | + "test": "npx jest", |
| 8 | + "test:watch": "jest --watch", |
| 9 | + "build": "npm run test && rollup --config rollup.config.ts --configPlugin typescript && npm run generate-types", |
8 | 10 | "prepublishOnly": "npm run build", |
9 | 11 | "generate-types": "tsc --project tsconfig.types.json && rollup --config rollup.types.config.ts --configPlugin typescript && rm -rf ./dist/types" |
10 | 12 | }, |
|
31 | 33 | "@babel/core": "7.17.7", |
32 | 34 | "@babel/plugin-proposal-class-properties": "7.16.7", |
33 | 35 | "@babel/plugin-proposal-optional-chaining": "7.16.7", |
| 36 | + "@babel/plugin-transform-modules-commonjs": "^7.17.7", |
34 | 37 | "@babel/preset-env": "7.16.11", |
35 | 38 | "@babel/preset-typescript": "7.16.7", |
36 | 39 | "@babel/runtime": "7.17.7", |
|
41 | 44 | "@rollup/plugin-json": "4.1.0", |
42 | 45 | "@rollup/plugin-node-resolve": "13.1.3", |
43 | 46 | "@rollup/plugin-typescript": "^8.3.1", |
| 47 | + "@types/jest": "^27.4.1", |
44 | 48 | "@types/once": "^1.4.0", |
45 | 49 | "@types/rollup-plugin-node-builtins": "^2.1.2", |
46 | 50 | "@types/vscode": "^1.65.0", |
|
51 | 55 | "eslint-config-standard": "17.0.0-1", |
52 | 56 | "eslint-config-standard-jsx": "11.0.0-1", |
53 | 57 | "eslint-plugin-import": "2.25.4", |
| 58 | + "eslint-plugin-jest": "^26.1.1", |
54 | 59 | "eslint-plugin-node": "11.1.0", |
55 | 60 | "eslint-plugin-promise": "6.0.0", |
56 | 61 | "eslint-plugin-unused-imports": "2.0.0", |
| 62 | + "jest": "^27.5.1", |
57 | 63 | "monaco-languageclient": "^0.18.0", |
58 | 64 | "proxy-polyfill": "^0.3.2", |
59 | 65 | "rollup": "2.70.1", |
|
76 | 82 | "not IE 11", |
77 | 83 | "not IE_Mob 11" |
78 | 84 | ], |
| 85 | + "jest": { |
| 86 | + "testEnvironment": "jest-environment-jsdom", |
| 87 | + "modulePathIgnorePatterns": [ |
| 88 | + "<rootDir>/dist/" |
| 89 | + ], |
| 90 | + "setupFiles": [ |
| 91 | + "<rootDir>/browserMock.js" |
| 92 | + ], |
| 93 | + "transformIgnorePatterns": [ |
| 94 | + "^.+\\.module\\.(css|sass|scss)$" |
| 95 | + ], |
| 96 | + "transform": { |
| 97 | + "^(?!.*\\.(js|ts|css|json)$)": "<rootDir>/jest/fileTransform.js", |
| 98 | + "^.+\\.css$": "<rootDir>/jest/cssTransform.js", |
| 99 | + "^.+\\.(js|ts)$": [ |
| 100 | + "<rootDir>/node_modules/babel-jest", |
| 101 | + { |
| 102 | + "configFile": "./babel.test.config.js" |
| 103 | + } |
| 104 | + ] |
| 105 | + }, |
| 106 | + "moduleNameMapper": { |
| 107 | + "^vscode$": "monaco-languageclient/lib/vscode-compatibility", |
| 108 | + "^monaco-editor$": "monaco-editor/esm/vs/editor/edcore.main", |
| 109 | + "^monaco-editor-core$": "monaco-editor/esm/vs/editor/edcore.main" |
| 110 | + } |
| 111 | + }, |
79 | 112 | "volta": { |
80 | 113 | "node": "16.14.0", |
81 | 114 | "npm": "8.5.0" |
|
0 commit comments