Skip to content

Commit

Permalink
feat(ci): 支持 Windows 环境测试 (#13739)
Browse files Browse the repository at this point in the history
* feat(ci): 支持 Windows 环境测试

* fix(win): 修复 window mkdir 报错

* fix: 修复因操作系统路径分割符不同导致测试用例不通过的问题

* fix: 修复taro-cli测试用例报错

* fix: 修复 fs 引入问题

* feat(jest): update snapshot resolver

* feat(jest): update snapshot resolver

* feat: win环境下,获取shell值兜底

* feat: windows 的info保持原状

* feat: 不修改运行代码,修改测试用例,实在找不到windows环境下获取当前 shell 信息的方法

* style: 删除多余的空行

* fix(rn-runner): 兼容 win 路径分隔符

* fix(wins): 修复路径对齐方法

* test(cli): udpate info

---------

Co-authored-by: [email protected] <[email protected]>
Co-authored-by: liuzejia <[email protected]>
Co-authored-by: biorz <“[email protected]”>
Co-authored-by: unknown <[email protected]>
  • Loading branch information
5 people authored Nov 8, 2023
1 parent f68cc61 commit 5b9a80b
Show file tree
Hide file tree
Showing 22 changed files with 12 additions and 7 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ permissions:

jobs:
build:

runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node-version: [14.x, 16.x]
os: [windows-latest, ubuntu-latest]
exclude:
- os: windows-latest
node-version: 16.x

runs-on: ${{ matrix.os }}

steps:
- name: Checkout
Expand Down
Empty file modified .husky/commit-msg
100755 → 100644
Empty file.
Empty file modified .husky/pre-commit
100755 → 100644
Empty file.
Empty file modified packages/create-app/src/createApp.ts
100755 → 100644
Empty file.
Empty file modified packages/create-app/src/index.ts
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion packages/jest-helper/src/sequencer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Test } from 'jest-runner'
const Sequencer = require('@jest/test-sequencer').default

export default class CustomSequencer extends Sequencer {
sort(tests: Test[]) {
sort (tests: Test[]) {
const copyTests = Array.from(tests)
return copyTests.sort((testA, testB) => testA.path.localeCompare(testB.path))
}
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-helper/src/snapshot/serializers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const snapshotObject2String = (val: Record<string, string>) => {
}

export const serialize = (
val: any
val: any,
// config: Config,
// indentation: string,
// depth: number,
Expand Down
Empty file modified packages/taro-cli-convertor/bin/taro-convert
100755 → 100644
Empty file.
1 change: 1 addition & 0 deletions packages/taro-cli/bin/taro
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
require('../dist/util').printPkgVersion()

const CLI = require('../dist/cli').default

new CLI().run()
Empty file modified packages/taro-components/src/utils/index.ts
100755 → 100644
Empty file.
Empty file.
1 change: 1 addition & 0 deletions packages/taro-mini-runner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
"babel-jest": "^29.5.0",
"jest": "^29.3.1",
"jest-cli": "^29.3.1",
"jest-taro-helper": "workspace:*",
"jest-transform-css": "^6.0.1",
"jest-environment-node": "^29.5.0",
"jest-taro-helper": "workspace:*",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as fs from 'fs-extra'
import { fs } from '@tarojs/helper'
import * as path from 'path'

let compile
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as fs from 'fs-extra'
import { fs } from '@tarojs/helper'

import { detailMock, indexMock } from './fixtures/prerender/vmMock'

Expand Down

0 comments on commit 5b9a80b

Please sign in to comment.