Skip to content

Commit

Permalink
fix(ci): 让 runner 在测试环境使用 node-sass。
Browse files Browse the repository at this point in the history
因为 sass 源码会修改 Function.prototype,而 jest 环境下这个 Function.prototype
和目标 function 的 constructor 不一致,导致报错。
  • Loading branch information
Chen-jj committed Apr 25, 2021
1 parent 0e42794 commit 18e60b9
Show file tree
Hide file tree
Showing 21 changed files with 1,621 additions and 1,549 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
"mock-socket": "^9.0.1",
"nerv-markdown-loader": "0.0.1",
"nervjs": "^1.4.6",
"node-sass": "5.0.0",
"npm-run-all": "^4.1.2",
"ora": "^2.1.0",
"power-assert": "^1.6.1",
Expand Down
351 changes: 154 additions & 197 deletions packages/babel-preset-taro/yarn.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions packages/eslint-config-taro/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,9 @@ ignore@^5.1.4:
integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==

is-core-module@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.2.0.tgz#97037ef3d52224d85163f5597b2b63d9afed981a"
integrity sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==
version "2.3.0"
resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.3.0.tgz#d341652e3408bca69c4671b79a0954a3d349f887"
integrity sha512-xSphU2KG9867tsYdLD4RWQ1VqdFl4HTO9Thf3I/3dLEfr0dbPTWKsuCKrgqMljg4nPE+Gq0VCnzT3gr0CyBmsw==
dependencies:
has "^1.0.3"

Expand Down
6 changes: 3 additions & 3 deletions packages/taro-cli/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3785,9 +3785,9 @@ is-ci@^1.0.10, is-ci@^1.0.8:
ci-info "^1.5.0"

is-core-module@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.2.0.tgz#97037ef3d52224d85163f5597b2b63d9afed981a"
integrity sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==
version "2.3.0"
resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.3.0.tgz#d341652e3408bca69c4671b79a0954a3d349f887"
integrity sha512-xSphU2KG9867tsYdLD4RWQ1VqdFl4HTO9Thf3I/3dLEfr0dbPTWKsuCKrgqMljg4nPE+Gq0VCnzT3gr0CyBmsw==
dependencies:
has "^1.0.3"

Expand Down
6 changes: 3 additions & 3 deletions packages/taro-components-rn/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4254,9 +4254,9 @@ is-ci@^2.0.0:
ci-info "^2.0.0"

is-core-module@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.2.0.tgz#97037ef3d52224d85163f5597b2b63d9afed981a"
integrity sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==
version "2.3.0"
resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.3.0.tgz#d341652e3408bca69c4671b79a0954a3d349f887"
integrity sha512-xSphU2KG9867tsYdLD4RWQ1VqdFl4HTO9Thf3I/3dLEfr0dbPTWKsuCKrgqMljg4nPE+Gq0VCnzT3gr0CyBmsw==
dependencies:
has "^1.0.3"

Expand Down
12 changes: 6 additions & 6 deletions packages/taro-components/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3272,9 +3272,9 @@ is-buffer@^1.1.5:
integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==

is-core-module@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.2.0.tgz#97037ef3d52224d85163f5597b2b63d9afed981a"
integrity sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==
version "2.3.0"
resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.3.0.tgz#d341652e3408bca69c4671b79a0954a3d349f887"
integrity sha512-xSphU2KG9867tsYdLD4RWQ1VqdFl4HTO9Thf3I/3dLEfr0dbPTWKsuCKrgqMljg4nPE+Gq0VCnzT3gr0CyBmsw==
dependencies:
has "^1.0.3"

Expand Down Expand Up @@ -3844,9 +3844,9 @@ kind-of@^6.0.0, kind-of@^6.0.2:
integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==

kolorist@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/kolorist/-/kolorist-1.4.0.tgz#5d04f467590e8a484d5ed9af96e9bb3364a8123b"
integrity sha512-f458vL7ZQ+tAZv+6/ewRVznA/qbbtf+JGU/8Kf3Bzpo8vGPkgZ2Y9d0bpO/lX6EZj5e+hdugfSuOGX7WXVHTnw==
version "1.4.1"
resolved "https://registry.yarnpkg.com/kolorist/-/kolorist-1.4.1.tgz#5ce60d5fefa23ca55a7e3203e16f7b9ed5b0556a"
integrity sha512-jucnNxW4qfamxkbT4hCLRk/WyAQD/aS0KIkY8z5VoQI5K9QF65nj7vTeuFcySO7eibxPQwVWM+mby1Hm9TyokQ==

lazystream@^1.0.0:
version "1.0.0"
Expand Down
411 changes: 215 additions & 196 deletions packages/taro-helper/yarn.lock

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions packages/taro-loader/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@


acorn-walk@^8.0.0:
version "8.0.2"
resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.0.2.tgz#d4632bfc63fd93d0f15fd05ea0e984ffd3f5a8c3"
integrity sha512-+bpA9MJsHdZ4bgfDcpk0ozQyhhVct7rzOmO0s1IIr0AGGgKBljss8n2zp11rRP2wid5VGeh04CgeKzgat5/25A==
version "8.1.0"
resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.1.0.tgz#d3c6a9faf00987a5e2b9bdb506c2aa76cd707f83"
integrity sha512-mjmzmv12YIG/G8JQdQuz2MUDShEJ6teYpT5bmWA4q7iwoGen8xtt3twF3OvzIUl+Q06aWIjvnwQUKvQ6TtMRjg==

acorn@^8.0.4:
version "8.1.1"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.1.1.tgz#fb0026885b9ac9f48bac1e185e4af472971149ff"
integrity sha512-xYiIVjNuqtKXMxlRMDc6mZUhXehod4a3gbZ1qRlM7icK4EbxUFNLhWoPblCvFtB2Y9CIqHP3CF/rdxLItaQv8g==
version "8.2.1"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.2.1.tgz#0d36af126fb6755095879c1dc6fd7edf7d60a5fb"
integrity sha512-z716cpm5TX4uzOzILx8PavOE6C6DKshHDw1aQN52M/yNSqE9s5O8SMfyhCCfCJ3HmTL0NkVOi+8a/55T7YB3bg==

big.js@^5.2.2:
version "5.2.2"
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-mini-runner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"css": "2.2.4",
"css-loader": "^3.0.0",
"css-what": "3.3.0",
"csso-webpack-plugin": "^1.0.0-beta.12",
"csso-webpack-plugin": "2.0.0-beta.3",
"fibers": "5.0.0",
"file-loader": "^6.0.0",
"fs-extra": "^8.0.1",
Expand Down
9 changes: 9 additions & 0 deletions packages/taro-mini-runner/src/__tests__/setup/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ jest.mock('@tarojs/helper', () => {
}
})

jest.mock('sass', () => {
const originalModule = jest.requireActual('node-sass')
return {
__esModule: true,
...originalModule,
printLog () {}
}
})

jest.mock('../../utils/logHelper', () => {
const originalModule = jest.requireActual('../../utils/logHelper')
return {
Expand Down
Loading

0 comments on commit 18e60b9

Please sign in to comment.