Skip to content
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.

Commit

Permalink
chore(typescript): convert tests to use typescript as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Marosi committed Oct 31, 2019
1 parent 4d0760d commit 8126f86
Show file tree
Hide file tree
Showing 26 changed files with 308 additions and 209 deletions.
4 changes: 2 additions & 2 deletions .storybook/config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {configure} from '@storybook/react'
import { configure } from '@storybook/react'

function loadStories() {
require('../src/calendar/stories/index.js')
require('../src/calendar/stories/index.jsx')
}

configure(loadStories, module)
2 changes: 1 addition & 1 deletion dist/simple-calendar.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/simple-calendar.js.map

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
module.exports = {
collectCoverage: true,
coverageDirectory: './coverage/',
setupFiles: ['<rootDir>/config/_jest/setupTests.js', 'jest-plugin-context/setup'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
setupFiles: ['<rootDir>/config/_jest/setupTests.js'],
snapshotSerializers: ['enzyme-to-json/serializer'],
testMatch: ['**/__specs__/**/*.js'],
testMatch: ['**/__specs__/**/*.tsx'],
testPathIgnorePatterns: ['/node_modules/', '/fixtures/', '/dist'],
testURL: 'http://localhost/',
}
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,11 @@
"@storybook/react": "^5.0.3",
"@storybook/storybook-deployer": "^2.8.1",
"@types/classnames": "^2.2.9",
"@types/jest": "^24.0.21",
"autoprefixer": "^9.5.0",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.0.1",
"babel-jest": "^24.5.0",
"babel-jest": "^24.9.0",
"babel-loader": "^8.0.0",
"commitizen": "^4.0.3",
"cross-env": "^6.0.3",
Expand All @@ -106,14 +107,12 @@
"html-webpack-plugin": "^3.2.0",
"html-webpack-template": "^6.2.0",
"husky": "^3.0.8",
"jest": "^24.5.0",
"jest-plugin-context": "^2.9.0",
"jest-plugins": "^2.9.0",
"jest": "^24.9.0",
"lint-staged": "^9.4.1",
"markdown-table": "^1.1.3",
"mockdate": "^2.0.2",
"prettier-standard": "^15.0.1",
"react-test-renderer": "^16.8.4",
"react-test-renderer": "^16.11.0",
"semantic-release": "^15.13.24",
"style-loader": "^1.0.0",
"stylus": "^0.54.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,4 +371,4 @@ exports[`Calendar #render renders <Calendar /> 1`] = `
</div>
</div>
</div>
`
`;
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exports[`Day #render class variations when prop \`isCurrentMonth\` is \`true\` r
>
5
</button>
`
`;

exports[`Day #render class variations when prop \`isDisabled\` is \`true\` renders <Day /> 1`] = `
<button
Expand All @@ -20,7 +20,7 @@ exports[`Day #render class variations when prop \`isDisabled\` is \`true\` rende
>
5
</button>
`
`;

exports[`Day #render class variations when prop \`isHighlighted\` is \`true\` renders <Day /> 1`] = `
<button
Expand All @@ -31,7 +31,7 @@ exports[`Day #render class variations when prop \`isHighlighted\` is \`true\` re
>
5
</button>
`
`;

exports[`Day #render class variations when prop \`isMonthNext\` is \`true\` renders <Day /> 1`] = `
<button
Expand All @@ -42,7 +42,7 @@ exports[`Day #render class variations when prop \`isMonthNext\` is \`true\` rend
>
5
</button>
`
`;

exports[`Day #render class variations when prop \`isMonthPrev\` is \`true\` renders <Day /> 1`] = `
<button
Expand All @@ -53,7 +53,7 @@ exports[`Day #render class variations when prop \`isMonthPrev\` is \`true\` rend
>
5
</button>
`
`;

exports[`Day #render class variations when prop \`isNonSelectable\` is \`true\` renders <Day /> 1`] = `
<button
Expand All @@ -64,7 +64,7 @@ exports[`Day #render class variations when prop \`isNonSelectable\` is \`true\`
>
5
</button>
`
`;

exports[`Day #render class variations when prop \`isSelectable\` is \`true\` renders <Day /> 1`] = `
<button
Expand All @@ -75,7 +75,7 @@ exports[`Day #render class variations when prop \`isSelectable\` is \`true\` ren
>
5
</button>
`
`;

exports[`Day #render class variations when prop \`isSelected\` is \`true\` renders <Day /> 1`] = `
<button
Expand All @@ -86,7 +86,7 @@ exports[`Day #render class variations when prop \`isSelected\` is \`true\` rende
>
5
</button>
`
`;

exports[`Day #render class variations when prop \`isSelectionEnd\` is \`true\` renders <Day /> 1`] = `
<button
Expand All @@ -97,7 +97,7 @@ exports[`Day #render class variations when prop \`isSelectionEnd\` is \`true\` r
>
5
</button>
`
`;

exports[`Day #render class variations when prop \`isSelectionStart\` is \`true\` renders <Day /> 1`] = `
<button
Expand All @@ -108,7 +108,7 @@ exports[`Day #render class variations when prop \`isSelectionStart\` is \`true\`
>
5
</button>
`
`;

exports[`Day #render class variations when prop \`isToday\` is \`true\` renders <Day /> 1`] = `
<button
Expand All @@ -119,7 +119,7 @@ exports[`Day #render class variations when prop \`isToday\` is \`true\` renders
>
5
</button>
`
`;

exports[`Day #render class variations when prop \`isWeekend\` is \`true\` renders <Day /> 1`] = `
<button
Expand All @@ -130,7 +130,7 @@ exports[`Day #render class variations when prop \`isWeekend\` is \`true\` render
>
5
</button>
`
`;

exports[`Day #render class variations when prop \`isWorkday\` is \`true\` renders <Day /> 1`] = `
<button
Expand All @@ -141,7 +141,7 @@ exports[`Day #render class variations when prop \`isWorkday\` is \`true\` render
>
5
</button>
`
`;

exports[`Day #render renders <Day /> 1`] = `
<button
Expand All @@ -152,4 +152,4 @@ exports[`Day #render renders <Day /> 1`] = `
>
5
</button>
`
`;
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ exports[`MonthHeader #render renders <MonthHeader /> 1`] = `
type="next"
/>
</div>
`
`;

exports[`MonthHeader #render when prop \`maxDate\` is before prop \`activeMonth\` renders <MonthHeader /> 1`] = `
<div
Expand All @@ -50,7 +50,7 @@ exports[`MonthHeader #render when prop \`maxDate\` is before prop \`activeMonth\
type="next"
/>
</div>
`
`;

exports[`MonthHeader #render when prop \`minDate\` is after prop \`activeMonth\` renders <MonthHeader /> 1`] = `
<div
Expand All @@ -76,4 +76,4 @@ exports[`MonthHeader #render when prop \`minDate\` is after prop \`activeMonth\`
type="next"
/>
</div>
`
`;
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ exports[`Notice when prop \`type\` is "disabled_day_click" renders <Notice /> 1`
>
Selected range must not overlap with disabled dates.
</div>
`
`;

exports[`Notice when prop \`type\` is "overlapping_with_disabled" renders <Notice /> 1`] = `
<div
className="example-class-name-notice"
>
Selected range must not overlap with disabled dates.
</div>
`
`;
Loading

0 comments on commit 8126f86

Please sign in to comment.