From 4a99eebdd6ce11d540d05221216fa16c092e982f Mon Sep 17 00:00:00 2001 From: johnche Date: Wed, 27 Nov 2024 20:29:58 +0800 Subject: [PATCH] =?UTF-8?q?[unity]=E8=AF=95=E4=B8=8B=E5=85=88=E7=A7=BB?= =?UTF-8?q?=E9=99=A4Nunit=E7=84=B6=E5=90=8E=E9=87=8D=E6=96=B0=E5=AE=89?= =?UTF-8?q?=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- unity/cli/test.mjs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/unity/cli/test.mjs b/unity/cli/test.mjs index 54fd7053e5..abee8aa3f6 100644 --- a/unity/cli/test.mjs +++ b/unity/cli/test.mjs @@ -77,6 +77,11 @@ async function runTest(cwd, copyConfig, runInReflection, filter = '') { mkdir("-p", workdir); exec(`dotnet new nunit`, { cwd: workdir }); + assert.equal(0, exec(`dotnet remove package NUnit`, { cwd: workdir }).code); + assert.equal(0, exec(`dotnet remove package NUnit3TestAdapter`, { cwd: workdir }).code); + assert.equal(0, exec(`dotnet add package NUnit --version 3.14.0`, { cwd: workdir }).code); + assert.equal(0, exec(`dotnet add package NUnit3TestAdapter --version 4.5.0`, { cwd: workdir }).code); + assert.equal(0, exec(`dotnet restore`, { cwd: workdir }).code); rm('-rf', join(workdir, 'UnitTest1.cs')); rm('-rf', join(workdir, 'Usings.cs')); @@ -127,7 +132,6 @@ async function runTest(cwd, copyConfig, runInReflection, filter = '') { // 运行测试 assert.equal(0, exec(`dotnet build ${testProjectName}.csproj -p:StartupObject=PuertsTest -v quiet`, { cwd: workdir }).code); - assert.equal(0, exec(`dotnet add package NUnit --version 3.14.0`, { cwd: workdir }).code); assert.equal(0, exec(`dotnet test ${testProjectName}.csproj --blame-hang-timeout 10000ms ${filter ? `--filter ${filter}` : ''}`, { cwd: workdir }).code); }