|
| 1 | +import assert from "assert" |
| 2 | +import path from "path" |
| 3 | +import { describe } from "mocha"; |
| 4 | +import linux from '../../../runner/module-linux' |
| 5 | +import windows from '../../../runner/module-windows' |
| 6 | +import * as fs from 'fs' |
| 7 | + |
| 8 | +describe("issue - 129", function () { |
| 9 | + describe("issue: linux output should equal with wine", function () { |
| 10 | + it("crash", async function () { |
| 11 | + const p = path.resolve(__dirname, './data/example.json') |
| 12 | + const storagePath = path.resolve( |
| 13 | + __dirname, |
| 14 | + `issue-129/${this.test?.title}` |
| 15 | + ); |
| 16 | + try { |
| 17 | + fs.mkdirSync(storagePath, { recursive: true }); |
| 18 | + } catch (error) {} |
| 19 | + |
| 20 | + const w = await windows.wcsc(p); |
| 21 | + const n = await linux.wcsc(p, '', storagePath); |
| 22 | + // console.log('windows:', typeof w) |
| 23 | + // console.log('linux:', typeof n) |
| 24 | + |
| 25 | + fs.writeFileSync( |
| 26 | + `${storagePath}/wine-output.json`, |
| 27 | + JSON.stringify(w, null, 4) |
| 28 | + ); |
| 29 | + fs.writeFileSync( |
| 30 | + `${storagePath}/node-output.json`, |
| 31 | + JSON.stringify(n, null, 4) |
| 32 | + ); |
| 33 | + assert.equal(typeof n, typeof w); |
| 34 | + assert.equal(w.success, true) |
| 35 | + assert.deepEqual(n, w); |
| 36 | + }); |
| 37 | + }); |
| 38 | +}); |
0 commit comments