Skip to content

Commit

Permalink
将 dev 和 pro 两个同样的测试集中在一个文件
Browse files Browse the repository at this point in the history
  • Loading branch information
coder-hxl committed Nov 30, 2022
1 parent 832c41c commit 760046e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 193 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
"main": "src/index.ts",
"scripts": {
"build": "rollup --config rollup.config.mjs",
"build-strict": "pnpm dev-test && pnpm build && pnpm pro-test",
"test": "rollup --watch --config script/test.mjs",
"dev-test": "jest test/dev.test.ts",
"pro-test": "jest test/pro.test.ts",
"dev-test": "jest test/model.test.ts dev",
"pro-test": "jest test/model.test.ts pro",
"prettier": "prettier --write ."
},
"devDependencies": {
Expand Down
189 changes: 0 additions & 189 deletions test/dev.test.ts

This file was deleted.

13 changes: 11 additions & 2 deletions test/pro.test.ts → test/model.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
import process from 'process'
import { expect, test } from '@jest/globals'

import { IXlStore } from '../src/types'

const xlStore: IXlStore = require('../publish/lib/index')
const args = process.argv.splice(3)
const model = args[0]

let xlStore: IXlStore
if (model === 'dev') {
xlStore = require('../src/index').default
} else if (model === 'pro') {
xlStore = require('../publish/lib')
}

/* test */
function testWatchAPI() {
const record = [
{ name: 'count', count: 0, value: null },
Expand Down

0 comments on commit 760046e

Please sign in to comment.