wx-compiler/test/spec/wcc/empty/version.spec.ts
msojocs 754a09886e
chore: 使用新的CI流程 (#11)
* fix: wine environment

* fix: wine environment

* fix: environment

* perf: remove recommend

* fix: env

* Update release.yml

* fix: permission of wcsc.exe

* fix: 一处越界问题

* fix: pnpm install

* fix: wine prepare

* fix: wine cfg

* feat: error console

* fix: 兼容clang

* perf: 调整位置

* perf: 带入环境

* fix: version

* perf: log

* fix: version check

* fix: version
2025-01-22 16:55:30 +08:00

39 lines
1.2 KiB
TypeScript

import assert from 'assert';
import path from 'path';
import linux from '../../../runner/binary-linux'
import windows from '../../../runner/binary-windows'
import * as fs from 'fs'
describe("wcc - empty", function () {
describe("Empty: default command output", function () {
it("版本", async function () {
const projectPath = __dirname;
const args: string[] = [
"-v"
];
let w = ""
try
{
w = (await windows.wcc(args, projectPath)).replace(/\r\n/g, '\n')
}
catch(err: any){
console.error('error:', err)
w = err.stdout.replace(/\r\n/g, '\n')
}
const n = await linux.wcc(args, projectPath);
const storagePath = path.resolve(
__dirname,
`version/${this.test?.title}`
);
try {
fs.mkdirSync(storagePath, { recursive: true });
} catch (error) {}
fs.writeFileSync(`${storagePath}/wine-output.js`, w);
fs.writeFileSync(`${storagePath}/node-output.js`, n);
assert.equal(n, w, `wine: ${w}\n\nlinux: ${n}`);
});
});
});