diff --git a/packages/uni-cli-shared/__tests__/console.spec.ts b/packages/uni-cli-shared/__tests__/console.spec.ts index 2f361fdf6f4fcc2d21fd286e225a7e5c200b6f54..0514d4b6d59250ec9fdec8b9f97f74f90dac2d6a 100644 --- a/packages/uni-cli-shared/__tests__/console.spec.ts +++ b/packages/uni-cli-shared/__tests__/console.spec.ts @@ -1,5 +1,4 @@ import { rewriteConsoleExpr } from '../src/logs/console' -import { normalizeLog } from '../src/hbx/formatLog' const filename = 'foo.vue' describe('console', () => { test('console.log', () => { @@ -41,11 +40,4 @@ console.log(a,b,c); rewriteConsoleExpr(filename, `console.info(a,b,c);`) ).toMatchSnapshot() }) - test('console.log format', () => { - expect( - normalizeLog('log', 'at ' + filename + ':1', ['a', 'b', { a: 1 }]) - ).toBe( - `a---COMMA---b---COMMA------BEGIN:JSON---{"a":1}---END:JSON--- at foo.vue:1` - ) - }) }) diff --git a/packages/uni-shared/__tests__/hbx/console.spec.ts b/packages/uni-shared/__tests__/hbx/console.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..de17fae9066bb89bdccec54045a28e8c6cb0fc1b --- /dev/null +++ b/packages/uni-shared/__tests__/hbx/console.spec.ts @@ -0,0 +1,11 @@ +import { normalizeLog } from '../../src/hbx/formatLog' +const filename = 'foo.vue' +describe('console', () => { + test('console.log format', () => { + expect( + normalizeLog('log', 'at ' + filename + ':1', ['a', 'b', { a: 1 }]) + ).toBe( + `a---COMMA---b---COMMA------BEGIN:JSON---{"a":1}---END:JSON--- at foo.vue:1` + ) + }) +})