From 4d8c4abf731f0121bf212a026880f7109529bee7 Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Mon, 11 Oct 2021 13:18:37 +0800 Subject: [PATCH] wip(mp): tests --- packages/uni-mp-compiler/__tests__/test.spec.ts | 10 ++++++---- packages/uni-mp-compiler/__tests__/testUtils.ts | 14 ++++++++------ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/packages/uni-mp-compiler/__tests__/test.spec.ts b/packages/uni-mp-compiler/__tests__/test.spec.ts index 65fc7499b..ea2203e43 100644 --- a/packages/uni-mp-compiler/__tests__/test.spec.ts +++ b/packages/uni-mp-compiler/__tests__/test.spec.ts @@ -7,10 +7,12 @@ function assert(template: string, templateCode: string, renderCode: string) { filename: 'foo.vue', prefixIdentifiers: true, inline: true, - emitFile({ source }) { - console.log(source) - // expect(source).toBe(templateCode) - return '' + miniProgram: { + emitFile({ source }) { + console.log(source) + // expect(source).toBe(templateCode) + return '' + }, }, }) // expect(res.template).toBe(templateCode) diff --git a/packages/uni-mp-compiler/__tests__/testUtils.ts b/packages/uni-mp-compiler/__tests__/testUtils.ts index 9f60b89de..35fb44a77 100644 --- a/packages/uni-mp-compiler/__tests__/testUtils.ts +++ b/packages/uni-mp-compiler/__tests__/testUtils.ts @@ -13,12 +13,14 @@ export function assert( filename: 'foo.vue', prefixIdentifiers: true, inline: true, - emitFile({ source }) { - // console.log(source) - if (!options.onError) { - expect(source).toBe(templateCode) - } - return '' + miniProgram: { + emitFile({ source }) { + // console.log(source) + if (!options.onError) { + expect(source).toBe(templateCode) + } + return '' + }, }, ...options, }) -- GitLab