wx-compiler/test/spec/wcsc/empty/version.spec.ts
2024-06-30 17:31:37 +08:00

33 lines
1.1 KiB
TypeScript

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