From 6ad78ec7c7976bed19400c90be403653e6c44f2f Mon Sep 17 00:00:00 2001 From: TZ Date: Tue, 30 Aug 2022 14:51:30 +0800 Subject: [PATCH] test: fix win --- package.json | 2 +- test/operation.test.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 0d9946d..5ee006d 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "scripts": { "lint": "eslint .", "test": "vitest", - "cov": "vitest run --coverage", + "cov": "vitest run operation --allowOnly --coverage", "ci": "npm run lint && npm run cov" }, "ci": { diff --git a/test/operation.test.js b/test/operation.test.js index 81adafe..7eb3bde 100644 --- a/test/operation.test.js +++ b/test/operation.test.js @@ -55,12 +55,13 @@ describe('test/operation.test.js', () => { .notStderr('bad option: --no-collect'); }, 10000); - it('should support log()', async () => { + it.only('should support log()', async () => { await runner() .spawn('npm -v') .log('stdout: %s, code: %d', 'result.stdout', 'result.code') .log('result'); + console.warn('@@@ "%s"...', console.info.calls.join('\n')); expect(console.info).toHaveBeenCalledWith(expect.stringMatching(/\[CLET\] stdout: \d+\.\d+\.\d+, code: 0/)); expect(console.info).toHaveBeenCalledWith(expect.stringMatching(/\[CLET\] \{ stdout:.*/)); });