From cec876c760ad234f7ad17473a7bfad2c20bdcb2f Mon Sep 17 00:00:00 2001 From: msojocs Date: Sat, 26 Aug 2023 20:28:50 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E6=B7=BB=E5=8A=A0wcsc=20raw=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++- .../spec/wcsc/raw/{raw.test.js => raw.spec.ts} | 18 +++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) rename test/spec/wcsc/raw/{raw.test.js => raw.spec.ts} (95%) diff --git a/.gitignore b/.gitignore index cd9ef36..8fdc1ab 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ node_modules *output.json *err.js *stderr.json -.cache \ No newline at end of file +.cache +*/spec/**/*.js \ No newline at end of file diff --git a/test/spec/wcsc/raw/raw.test.js b/test/spec/wcsc/raw/raw.spec.ts similarity index 95% rename from test/spec/wcsc/raw/raw.test.js rename to test/spec/wcsc/raw/raw.spec.ts index 7fbc4b8..d306b5a 100644 --- a/test/spec/wcsc/raw/raw.test.js +++ b/test/spec/wcsc/raw/raw.spec.ts @@ -1,8 +1,8 @@ -const assert = require("assert"); -const node = require("../../runner/node"); -const wine = require("../../runner/wine"); -const path = require("path"); -const fs = require("fs"); +import assert from "assert"; +import path from "path"; +import node from '../../../runner/node' +import wine from '../../../runner/wine' +import * as fs from 'fs' describe("wcsc", function () { describe("Raw: node output should equal with wine", function () { @@ -14,7 +14,7 @@ describe("wcsc", function () { it("主界面", async function () { const projectPath = path.resolve( __dirname, - "../../examples/miniprogram-demo/miniprogram" + "/mnt/d/Work/WeChatProjects/miniprogram-demo/miniprogram" ); const args = [ "-db", @@ -43,7 +43,7 @@ describe("wcsc", function () { const n = await node.wcsc(args, projectPath); const storagePath = path.resolve( __dirname, - `miniprogram-demo/${this.test.title}` + `miniprogram-demo/${this.test?.title}` ); try { fs.mkdirSync(storagePath, { recursive: true }); @@ -61,7 +61,7 @@ describe("wcsc", function () { it("接口-设置界面标题", async function () { const projectPath = path.resolve( __dirname, - "../../examples/miniprogram-demo/miniprogram/" + "/mnt/d/Work/WeChatProjects/miniprogram-demo/miniprogram/" ); const args = [ "-db", @@ -166,7 +166,7 @@ describe("wcsc", function () { const n = await node.wcsc(args, projectPath); const storagePath = path.resolve( __dirname, - `miniprogram-demo/${this.test.title}` + `miniprogram-demo/${this.test?.title}` ); try { fs.mkdirSync(storagePath, { recursive: true });