Skip to content

Commit

Permalink
test: add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
neuqzxy committed Jun 11, 2024
1 parent c342b72 commit 322a59b
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
9 changes: 9 additions & 0 deletions packages/vstory/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dist
build
esm
cjs
node_modules
coverage

# ignore big data files
__tests__/data/*
11 changes: 11 additions & 0 deletions packages/vstory/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,16 @@ module.exports = {
__VERSION__: 'readonly',
NodeJS: true
},
overrides: [
{
files: ['**/__tests__/**', '**/*.test.ts'],
// 测试文件允许以下规则
rules: {
'@typescript-eslint/no-empty-function': 'off',
'no-console': 'off',
'dot-notation': 'off'
}
}
],
ignorePatterns: ['scripts/**', 'demo/**']
};
5 changes: 5 additions & 0 deletions packages/vstory/__tests__/unit/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe('VChart Editor', () => {
it('should get the correct version', () => {
expect(1).toBeDefined();
});
});
2 changes: 1 addition & 1 deletion packages/vstory/tsconfig.eslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"outDir": "./es",
"composite": true
},
"include": ["src", "demo", "examples"],
"include": ["src", "__tests__", "demo", "examples"],
"exclude": ["bugserver-config", "src/common/inversify-lite"],
"references": []
}

0 comments on commit 322a59b

Please sign in to comment.