Skip to content

Commit

Permalink
Transform tests into TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
oamaok committed Dec 18, 2023
1 parent 1d774c3 commit e4aaae6
Show file tree
Hide file tree
Showing 7 changed files with 924 additions and 575 deletions.
4 changes: 2 additions & 2 deletions babel.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ if (process.env.KAIKU_JSX_RUNTIME) {
const nodeEnv =
process.env.KAIKU_VERSION === 'development' ? 'development' : 'production'
module.exports = {
presets: ['@babel/preset-env'],
presets: ['@babel/preset-env', '@babel/preset-typescript'],
plugins: [
['transform-define', { 'process.env.NODE_ENV': nodeEnv }],
[
Expand All @@ -13,7 +13,7 @@ if (process.env.KAIKU_JSX_RUNTIME) {
}
} else {
module.exports = {
presets: ['@babel/preset-env'],
presets: ['@babel/preset-env', '@babel/preset-typescript'],
plugins: [
[
'@babel/plugin-transform-react-jsx',
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@
"prettier": "prettier --write .",
"prepublishOnly": "yarn build && yarn test && yarn lint && yarn typings"
},
"dependencies": {},
"devDependencies": {
"@babel/plugin-transform-async-to-generator": "^7.14.5",
"@babel/plugin-transform-react-jsx": "^7.14.5",
"@babel/preset-env": "^7.14.7",
"@babel/preset-typescript": "^7.23.3",
"@types/jest": "^29.5.11",
"@typescript-eslint/eslint-plugin": "^4.28.3",
"@typescript-eslint/parser": "^4.28.3",
"babel-plugin-transform-define": "^2.1.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ exports[`kaiku should handle updates with Object.keys 5`] = `"<div><span>foobar<

exports[`kaiku should handle updates with Object.keys 6`] = `"<div><span>foobar</span><span>barfoo</span></div>"`;

exports[`kaiku should not exhaust call stack with MANY nested elements 1`] = `"<div>I am the final child!</div>"`;

exports[`kaiku should not exhaust call stack with MANY nested elements 2`] = `"<div>I am the final child!</div>"`;

exports[`kaiku should not refire previous lazy props if component re-renders 1`] = `"<div id=\\"0\\">0</div>"`;
exports[`kaiku should not refire previous lazy props if component re-renders 2`] = `"<div id=\\"0\\">1</div>"`;
Expand Down
Loading

0 comments on commit e4aaae6

Please sign in to comment.