Skip to content

Commit

Permalink
Use vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
goto-bus-stop committed Dec 23, 2022
1 parent c5ca107 commit 298c72b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,19 @@
"scripts": {
"prepare": "rollup -c",
"lint": "eslint .",
"test": "npm run prepare && npm run tests-only && npm run lint",
"tests-only": "jest --testMatch '**/test/*.js' --coverage"
"test": "npm run tests-only && npm run lint",
"tests-only": "vitest run --coverage"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.3.0",
"@typescript-eslint/parser": "^5.3.0",
"@vitest/coverage-c8": "^0.26.2",
"eslint": "^8.2.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-import": "^2.22.0",
"jest": "^29.2.0",
"rollup": "^3.2.2",
"rollup-plugin-typescript2": "^0.34.0",
"typescript": "^4.0.2"
"rollup": "^3.8.1",
"rollup-plugin-typescript2": "^0.34.1",
"typescript": "^4.0.2",
"vitest": "^0.26.2"
}
}
5 changes: 3 additions & 2 deletions test/index.js → src/index.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const assert = require('assert');
const parseChatMarkup = require('..').default;
import assert from 'assert';
import { describe, it } from 'vitest';
import parseChatMarkup from './index.ts';

describe('parseChatMarkup', () => {
const bareOptions = {};
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ export default function parse(message: string, options: MarkupOptions = {}): Mar
return { type: 'link', text: token.text, href: httpify(token.text) };
case TokenType.Text:
return token.text;
/* istanbul ignore next */
/* c8 ignore next 2 */
default:
throw new Error('unreachable');
}
Expand Down

0 comments on commit 298c72b

Please sign in to comment.