Skip to content

Commit

Permalink
test: 💍 init test
Browse files Browse the repository at this point in the history
  • Loading branch information
waynewyang committed Dec 13, 2023
1 parent fbe0427 commit 2ab3379
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
dist
dist-test
yarn.lock
.env
5 changes: 3 additions & 2 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"loader" : "ts-node/esm",
"spec": "test/**/*.test.ts",
"exclude": ["node_modules"]
"spec": "dist-test/**/*.test.js",
"exclude": ["node_modules"],
"project": "./tsconfig.test.json"
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"types": "dist/index.d.ts",
"scripts": {
"build": "rm -rf ./dist;npx tsc",
"test": "mocha test/**/*.test.ts",
"build:test": "rm -rf ./dist-test;tsc -p tsconfig.test.json;",
"test": "npm run build:test; mocha ",
"readme": "npx readme-md-generator -p ./templates/readme.md",
"commit": "git-cz",
"release": "npm run build; git branch --show-current | grep -q '^main$' && release-it",
Expand Down
29 changes: 29 additions & 0 deletions test/test.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*******************************************************************************
* (c) 2023 unipackage
*
* Licensed under either the MIT License (the "MIT License") or the Apache License, Version 2.0
* (the "Apache License"). You may not use this file except in compliance with one of these
* licenses. You may obtain a copy of the MIT License at
*
* https://opensource.org/licenses/MIT
*
* Or the Apache License, Version 2.0 at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the MIT License or the Apache License for the specific language governing permissions and
* limitations under the respective licenses.
********************************************************************************/

import assert from "assert"
import { it } from "mocha"

//@ts-ignore
describe("xxxx Test", () => {
it("xxxx test", async () => {
console.log("ok")
})
})
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"resolveJsonModule": true,
"isolatedModules": false,
"jsx": "react",
"incremental": false
"incremental": false,
"declarationMap": true,
},
"include": ["src/**/*"],
"exclude": ["node_modules"],
Expand Down
27 changes: 27 additions & 0 deletions tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"compilerOptions": {
"outDir": "./dist-test",
"declaration": true,
"target": "ES2015",
"strict": true,
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true,
"module": "CommonJS",
"moduleResolution": "node",
"declarationMap": true,
"resolveJsonModule": true,
"experimentalDecorators": true,
"isolatedModules": false,
"skipLibCheck": true,
"jsx": "react",
"incremental": false,
},

"include": [
"test/**/*"
],

"exclude": [
"node_modules"
],
}

0 comments on commit 2ab3379

Please sign in to comment.