Skip to content

Commit

Permalink
其他
Browse files Browse the repository at this point in the history
  • Loading branch information
coder-hxl committed Nov 30, 2022
1 parent e0a35b1 commit 64fe201
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 28 deletions.
16 changes: 8 additions & 8 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

root = true

[*] # 表示所有文件适用
charset = utf-8 # 设置文件字符集为 utf-8
indent_style = space # 缩进风格(tab | space)
indent_size = 2 # 缩进大小
end_of_line = lf # 控制换行类型(lf | cr | crlf)
trim_trailing_whitespace = true # 去除行首的任意空白字符
insert_final_newline = true # 始终在文件末尾插入一个新行
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true

[*.md] # 表示仅 md 文件适用以下规则
[*.md]
max_line_length = off
trim_trailing_whitespace = false
14 changes: 2 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,2 @@
# 此文件用来忽略要上传的文件
# 配置规则:
# - 以斜杠“/”开头表示目录;
# - 以星号“*”通配多个字符;
# - 以问号“?”通配单个字符;
# - 以方括号“[]”包含单个字符的匹配列表;
# - 以叹号“!”表示不忽略(跟踪)匹配到的文件或目录;


node_modules/
miniprogram_npm/
upload/
node_modules
coverage
3 changes: 2 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};
collectCoverage: true
}
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +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/model.test.ts dev",
"pro-test": "jest test/model.test.ts pro",
"build-strict": "pnpm test-dev && pnpm build && pnpm test-pro",
"test-debug": "rollup --watch --config script/debug.mjs",
"test-dev": "jest test/model.test.ts dev",
"test-pro": "jest test/model.test.ts pro --coverage=false",
"prettier": "prettier --write ."
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions script/test.mjs → script/debug.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import terserPlugin from '@rollup/plugin-terser'
import runPlugin from '@rollup/plugin-run'

export default {
input: 'test/index.ts',
input: 'test/debug.ts',
output: {
file: 'test/index.js',
file: 'test/debug.js',
format: 'iife'
},
plugins: [tsPlugin(), terserPlugin(), runPlugin({ stdin: { clear: true } })]
Expand Down
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion test/model.test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import process from 'process'
import { expect, test } from '@jest/globals'

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

const args = process.argv.splice(3)
const model = args[0]

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

0 comments on commit 64fe201

Please sign in to comment.