refactor: node -> linux, wine -> windows

This commit is contained in:
msojocs 2023-08-31 09:17:03 +08:00
parent 1044f2d57c
commit 1288bd1aca
7 changed files with 50 additions and 50 deletions

View File

@ -1,7 +1,7 @@
import assert from "assert"
import path from "path"
import node from '../../../runner/node'
import wine from '../../../runner/wine'
import linux from '../../../runner/linux'
import windows from '../../../runner/windows'
import * as fs from 'fs'
describe("wcc - lla", function () {
@ -50,9 +50,9 @@ describe("wcc - lla", function () {
try {
fs.mkdirSync(storagePath, { recursive: true });
} catch (error) {}
const nodeRet = await node.wcc(args, projectPath, storagePath)
const nodeRet = await linux.wcc(args, projectPath, storagePath)
const n = JSON.parse(nodeRet);
const w = JSON.parse(await wine.wcc(args, projectPath));
const w = JSON.parse(await windows.wcc(args, projectPath));
fs.writeFileSync(
`${storagePath}/wine-output.json`,
JSON.stringify(w, null, 4)
@ -123,9 +123,9 @@ describe("wcc - lla", function () {
try {
fs.mkdirSync(storagePath, { recursive: true });
} catch (error) {}
const n = JSON.parse(await node.wcc(args, projectPath, storagePath));
const n = JSON.parse(await linux.wcc(args, projectPath, storagePath));
// console.log(n)
const w = JSON.parse(await wine.wcc(args, projectPath));
const w = JSON.parse(await windows.wcc(args, projectPath));
// console.log(w)
fs.writeFileSync(
`${storagePath}/wine-output.json`,
@ -168,8 +168,8 @@ describe("wcc - lla", function () {
try {
fs.mkdirSync(storagePath, { recursive: true });
} catch (error) {}
const w = JSON.parse(await wine.wcc(args, projectPath));
const n = JSON.parse(await node.wcc(args, projectPath, storagePath));
const w = JSON.parse(await windows.wcc(args, projectPath));
const n = JSON.parse(await linux.wcc(args, projectPath, storagePath));
fs.writeFileSync(
`${storagePath}/wine-output.json`,
JSON.stringify(w, null, 4)
@ -219,8 +219,8 @@ describe("wcc - lla", function () {
try {
fs.mkdirSync(storagePath, { recursive: true });
} catch (error) {}
const w = JSON.parse(await wine.wcc(args, projectPath));
const n = JSON.parse(await node.wcc(args, projectPath, storagePath));
const w = JSON.parse(await windows.wcc(args, projectPath));
const n = JSON.parse(await linux.wcc(args, projectPath, storagePath));
fs.writeFileSync(
`${storagePath}/wine-output.json`,
JSON.stringify(w, null, 4)
@ -312,8 +312,8 @@ describe("wcc - lla", function () {
try {
fs.mkdirSync(storagePath, { recursive: true });
} catch (error) {}
const w = JSON.parse(await wine.wcc(args, projectPath));
const n = JSON.parse(await node.wcc(args, projectPath, storagePath));
const w = JSON.parse(await windows.wcc(args, projectPath));
const n = JSON.parse(await linux.wcc(args, projectPath, storagePath));
fs.writeFileSync(
`${storagePath}/wine-output.json`,
JSON.stringify(w, null, 4)
@ -427,8 +427,8 @@ describe("wcc - lla", function () {
try {
fs.mkdirSync(storagePath, { recursive: true });
} catch (error) {}
const w = JSON.parse(await wine.wcc(args, projectPath));
const n = JSON.parse(await node.wcc(args, projectPath, storagePath));
const w = JSON.parse(await windows.wcc(args, projectPath));
const n = JSON.parse(await linux.wcc(args, projectPath, storagePath));
fs.writeFileSync(
`${storagePath}/wine-output.json`,
JSON.stringify(w, null, 4)

View File

@ -1,8 +1,8 @@
import assert from 'assert';
import path from 'path';
import node from '../../../runner/node'
import wine from '../../../runner/wine'
import linux from '../../../runner/linux'
import windows from '../../../runner/windows'
import * as fs from 'fs'
describe("wcc - llw", function () {
@ -51,8 +51,8 @@ describe("wcc - llw", function () {
try {
fs.mkdirSync(storagePath, { recursive: true });
} catch (error) {}
const n = JSON.parse(await node.wcc(args, projectPath, storagePath));
const w = JSON.parse(await wine.wcc(args, projectPath));
const n = JSON.parse(await linux.wcc(args, projectPath, storagePath));
const w = JSON.parse(await windows.wcc(args, projectPath));
fs.writeFileSync(
`${storagePath}/wine-output.json`,
JSON.stringify(w, null, 4)
@ -123,8 +123,8 @@ describe("wcc - llw", function () {
try {
fs.mkdirSync(storagePath, { recursive: true });
} catch (error) {}
const n = JSON.parse(await node.wcc(args, projectPath, storagePath));
const w = JSON.parse(await wine.wcc(args, projectPath));
const n = JSON.parse(await linux.wcc(args, projectPath, storagePath));
const w = JSON.parse(await windows.wcc(args, projectPath));
fs.writeFileSync(
`${storagePath}/wine-output.json`,
JSON.stringify(w, null, 4)
@ -165,8 +165,8 @@ describe("wcc - llw", function () {
try {
fs.mkdirSync(storagePath, { recursive: true });
} catch (error) {}
const n = JSON.parse(await node.wcc(args, projectPath, storagePath));
const w = JSON.parse(await wine.wcc(args, projectPath));
const n = JSON.parse(await linux.wcc(args, projectPath, storagePath));
const w = JSON.parse(await windows.wcc(args, projectPath));
fs.writeFileSync(
`${storagePath}/wine-output.json`,
JSON.stringify(w, null, 4)
@ -216,8 +216,8 @@ describe("wcc - llw", function () {
try {
fs.mkdirSync(storagePath, { recursive: true });
} catch (error) {}
const n = JSON.parse(await node.wcc(args, projectPath, storagePath));
const w = JSON.parse(await wine.wcc(args, projectPath));
const n = JSON.parse(await linux.wcc(args, projectPath, storagePath));
const w = JSON.parse(await windows.wcc(args, projectPath));
fs.writeFileSync(
`${storagePath}/wine-output.json`,
JSON.stringify(w, null, 4)
@ -267,8 +267,8 @@ describe("wcc - llw", function () {
try {
fs.mkdirSync(storagePath, { recursive: true });
} catch (error) {}
const n = JSON.parse(await node.wcc(args, projectPath, storagePath));
const w = JSON.parse(await wine.wcc(args, projectPath));
const n = JSON.parse(await linux.wcc(args, projectPath, storagePath));
const w = JSON.parse(await windows.wcc(args, projectPath));
fs.writeFileSync(
`${storagePath}/wine-output.json`,
JSON.stringify(w, null, 4)
@ -382,8 +382,8 @@ describe("wcc - llw", function () {
try {
fs.mkdirSync(storagePath, { recursive: true });
} catch (error) {}
const n = JSON.parse(await node.wcc(args, projectPath, storagePath));
const w = JSON.parse(await wine.wcc(args, projectPath));
const n = JSON.parse(await linux.wcc(args, projectPath, storagePath));
const w = JSON.parse(await windows.wcc(args, projectPath));
fs.writeFileSync(
`${storagePath}/wine-output.json`,
JSON.stringify(w, null, 4)

View File

@ -1,8 +1,8 @@
import assert from 'assert';
import path from 'path';
import node from '../../../runner/node'
import wine from '../../../runner/wine'
import linux from '../../../runner/linux'
import windows from '../../../runner/windows'
import * as fs from 'fs'
describe("wcc - raw", function () {
@ -42,8 +42,8 @@ describe("wcc - raw", function () {
"-gn",
"$gwx",
];
const w = (await wine.wcc(args, projectPath)).replace(/\r\n/g, '\n')
const n = await node.wcc(args, projectPath);
const w = (await windows.wcc(args, projectPath)).replace(/\r\n/g, '\n')
const n = await linux.wcc(args, projectPath);
const storagePath = path.resolve(
__dirname,
`miniprogram-demo/${this.test?.title}`
@ -93,8 +93,8 @@ describe("wcc - raw", function () {
"-gn",
"$7061636b616765536b796c696e652f",
];
const w = (await wine.wcc(args, projectPath)).replace(/\r\n/g, "\n");
const n = await node.wcc(args, projectPath);
const w = (await windows.wcc(args, projectPath)).replace(/\r\n/g, "\n");
const n = await linux.wcc(args, projectPath);
const storagePath = path.resolve(
__dirname,
`miniprogram-demo/${this.test?.title}`
@ -136,8 +136,8 @@ describe("wcc - raw", function () {
"-gn",
"$gwx",
];
const w = (await wine.wcc(args, projectPath)).replace(/\r\n/g, "\n");
const n = await node.wcc(args, projectPath);
const w = (await windows.wcc(args, projectPath)).replace(/\r\n/g, "\n");
const n = await linux.wcc(args, projectPath);
const storagePath = path.resolve(
__dirname,
`miniprogram-demo/${this.test?.title}`
@ -186,8 +186,8 @@ describe("wcc - raw", function () {
"-gn",
"$7061636b616765536b796c696e652f",
];
const w = (await wine.wcc(args, projectPath)).replace(/\r\n/g, "\n");
const n = await node.wcc(args, projectPath);
const w = (await windows.wcc(args, projectPath)).replace(/\r\n/g, "\n");
const n = await linux.wcc(args, projectPath);
const storagePath = path.resolve(
__dirname,
`miniprogram-demo/${this.test?.title}`

View File

@ -1,7 +1,7 @@
import assert from "assert";
import path from "path";
import node from '../../../runner/node'
import wine from '../../../runner/wine'
import linux from '../../../runner/linux'
import windows from '../../../runner/windows'
import * as fs from 'fs'
describe("wcsc", function () {
@ -39,8 +39,8 @@ describe("wcsc", function () {
"./page/common/index-skyline.wxss",
"-ll",
];
const w = JSON.parse(await wine.wcsc(args, projectPath));
const n = JSON.parse(await node.wcsc(args, projectPath));
const w = JSON.parse(await windows.wcsc(args, projectPath));
const n = JSON.parse(await linux.wcsc(args, projectPath));
const storagePath = path.resolve(__dirname, `miniprogram-demo/${this.test?.title}`)
try {
fs.mkdirSync(storagePath, {recursive: true});
@ -61,8 +61,8 @@ describe("wcsc", function () {
"/mnt/d/Work/WeChatProjects/miniprogram-demo/miniprogram/"
);
const args = ["-db","-pc","74","./packageAPI/pages/api/login/login.wxss","./packageAPI/pages/api/get-user-info/get-user-info.wxss","./packageAPI/pages/api/request-payment/request-payment.wxss","./packageAPI/pages/api/jump/jump.wxss","./packageAPI/pages/api/share/share.wxss","./packageAPI/pages/api/share-button/share-button.wxss","./packageAPI/pages/api/custom-message/custom-message.wxss","./packageAPI/pages/api/subscribe-message/subscribe-message.wxss","./packageAPI/pages/api/choose-address/choose-address.wxss","./packageAPI/pages/api/choose-invoice-title/choose-invoice-title.wxss","./packageAPI/pages/api/soter-authentication/soter-authentication.wxss","./packageAPI/pages/api/setting/setting.wxss","./packageAPI/pages/ar/visionkit-basic/visionkit-basic.wxss","./packageAPI/pages/ar/plane-ar/plane-ar.wxss","./packageAPI/pages/ar/2dmarker-ar/2dmarker-ar.wxss","./packageAPI/pages/ar/osd-ar/osd-ar.wxss","./packageAPI/pages/page/set-navigation-bar-title/set-navigation-bar-title.wxss","./packageAPI/pages/page/navigation-bar-loading/navigation-bar-loading.wxss","./packageAPI/pages/page/navigator/navigator.wxss","./packageAPI/pages/page/pull-down-refresh/pull-down-refresh.wxss","./packageAPI/pages/page/animation/animation.wxss","./packageAPI/pages/page/action-sheet/action-sheet.wxss","./packageAPI/pages/page/modal/modal.wxss","./packageAPI/pages/page/toast/toast.wxss","./packageAPI/pages/page/canvas/canvas.wxss","./packageAPI/pages/page/get-wxml-node-info/get-wxml-node-info.wxss","./packageAPI/pages/page/page-scroll/page-scroll.wxss","./packageAPI/pages/page/intersection-observer/intersection-observer.wxss","./packageAPI/pages/device/clipboard-data/clipboard-data.wxss","./packageAPI/pages/device/bluetooth/bluetooth.wxss","./packageAPI/pages/device/bluetooth/slave/slave.wxss","./packageAPI/pages/device/screen-brightness/screen-brightness.wxss","./packageAPI/pages/device/vibrate/vibrate.wxss","./packageAPI/pages/device/add-contact/add-contact.wxss","./packageAPI/pages/device/wifi/wifi.wxss","./packageAPI/pages/device/get-network-type/get-network-type.wxss","./packageAPI/pages/device/on-network-status-change/on-network-status-change.wxss","./packageAPI/pages/device/get-system-info/get-system-info.wxss","./packageAPI/pages/device/on-compass-change/on-compass-change.wxss","./packageAPI/pages/device/make-phone-call/make-phone-call.wxss","./packageAPI/pages/device/scan-code/scan-code.wxss","./packageAPI/pages/device/on-accelerometer-change/on-accelerometer-change.wxss","./packageAPI/pages/device/capture-screen/capture-screen.wxss","./packageAPI/pages/device/ibeacon/ibeacon.wxss","./packageAPI/pages/device/get-battery-info/get-battery-info.wxss","./packageAPI/pages/media/image/image.wxss","./packageAPI/pages/media/voice/voice.wxss","./packageAPI/pages/media/file/file.wxss","./packageAPI/pages/media/load-font-face/load-font-face.wxss","./packageAPI/pages/media/background-audio/background-audio.wxss","./packageAPI/pages/media/video/video.wxss","./packageAPI/pages/media/audio/audio.wxss","./packageAPI/pages/media/media-container/media-container.wxss","./packageAPI/pages/location/get-location/get-location.wxss","./packageAPI/pages/location/open-location/open-location.wxss","./packageAPI/pages/location/choose-location/choose-location.wxss","./packageAPI/pages/network/request/request.wxss","./packageAPI/pages/network/web-socket/web-socket.wxss","./packageAPI/pages/network/upload-file/upload-file.wxss","./packageAPI/pages/network/download-file/download-file.wxss","./packageAPI/pages/network/mdns/mdns.wxss","./packageAPI/pages/network/udp-socket/udp-socket.wxss","./packageAPI/pages/storage/storage/storage.wxss","./packageAPI/pages/storage/get-background-fetch-data/get-background-fetch-data.wxss","./packageAPI/pages/storage/get-background-prefetch-data/get-background-prefetch-data.wxss","./packageAPI/pages/performance/get-performance/get-performance.wxss","./packageAPI/pages/worker/worker/worker.wxss","./packageAPI/pages/framework/two-way-bindings/two-way-bindings.wxss","./packageAPI/pages/framework/wxs/wxs.wxss","./packageAPI/pages/framework/resizable/resizable.wxss","./packageAPI/pages/framework/wxs/movable.wxss","./packageAPI/pages/framework/wxs/sidebar.wxss","./packageAPI/pages/framework/wxs/stick-top.wxss","./packageAPI/pages/framework/wxs/nearby.wxss","./app.wxss","./common/common-skyline.wxss","./common/reset.wxss","./common/lib/weui.wxss","./component/navigation-bar/navigation-bar.wxss","./components/navigation-bar/index.wxss","./components/page-scroll/index.wxss","./page/API/index.wxss","./page/API/components/set-tab-bar/set-tab-bar.wxss","./page/cloud/index.wxss","./page/common/index-skyline.wxss","./page/component/index.wxss","./page/extend/index.wxss","./miniprogram_npm/miniprogram-barrage/index.wxss","./miniprogram_npm/miniprogram-recycle-view/recycle-item.wxss","./miniprogram_npm/miniprogram-recycle-view/recycle-view.wxss","./miniprogram_npm/wxml-to-canvas/index.wxss","--subpackage","packageAPI","-ll"]
const w = JSON.parse(await wine.wcsc(args, projectPath));
const n = JSON.parse(await node.wcsc(args, projectPath));
const w = JSON.parse(await windows.wcsc(args, projectPath));
const n = JSON.parse(await linux.wcsc(args, projectPath));
const storagePath = path.resolve(__dirname, `miniprogram-demo/${this.test?.title}`)
try {
fs.mkdirSync(storagePath, {recursive: true});

View File

@ -1,7 +1,7 @@
import assert from "assert";
import path from "path";
import node from '../../../runner/node'
import wine from '../../../runner/wine'
import linux from '../../../runner/linux'
import windows from '../../../runner/windows'
import * as fs from 'fs'
describe("wcsc", function () {
@ -39,8 +39,8 @@ describe("wcsc", function () {
"./page/common/index-skyline.wxss",
// "-ll",
];
const w = await wine.wcsc(args, projectPath);
const n = await node.wcsc(args, projectPath);
const w = await windows.wcsc(args, projectPath);
const n = await linux.wcsc(args, projectPath);
const storagePath = path.resolve(
__dirname,
`miniprogram-demo/${this.test?.title}`
@ -162,8 +162,8 @@ describe("wcsc", function () {
"packageAPI",
// "-ll",
];
const w = await wine.wcsc(args, projectPath);
const n = await node.wcsc(args, projectPath);
const w = await windows.wcsc(args, projectPath);
const n = await linux.wcsc(args, projectPath);
const storagePath = path.resolve(
__dirname,
`miniprogram-demo/${this.test?.title}`