Skip to content

Commit

Permalink
add mocha.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkhala committed Aug 19, 2023
1 parent f16aef0 commit e65c1d8
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 6 deletions.
11 changes: 8 additions & 3 deletions __tests__/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
describe(':for typescript', function () {
it('', async () => {

import Index, {type} from '../src/index';
import * as assert from 'assert';

describe('', () => {
it('', () => {
assert.strictEqual(new Index().constructor.name, 'Index');
assert.strictEqual(type, 'typescript');
});

});
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
{
"scripts": {
"compile": "tsc --project tsconfig.json",
"test": "jest"
"test": "jest",
"mocha-test": "ts-mocha test/*"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"devDependencies": {
"@types/jest": "latest",
"@typescript-eslint/eslint-plugin": "latest",
"@typescript-eslint/parser": "latest",
"eslint": "latest",
"jest": "latest",
"ts-jest": "latest",
"@types/jest": "latest",
"ts-mocha": "latest",
"typescript": "latest"
}
}
5 changes: 5 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default class Index {
constructor() {
}
}
export const type = 'typescript';
3 changes: 2 additions & 1 deletion test.tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"include": [
"__tests__/"
"__tests__/",
"test"
]
}
10 changes: 10 additions & 0 deletions test/mocha.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import * as assert from 'assert';
import Index, {type} from '../src';

describe('', () => {
it('', () => {
assert.strictEqual(new Index().constructor.name, 'Index');
assert.strictEqual(type, 'typescript');
});

});

0 comments on commit e65c1d8

Please sign in to comment.