-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix browser tests (Karma + Webpack setup). #1109
Changes from all commits
25b4718
82abb71
89986db
0a07a3e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,4 +38,3 @@ matrix: | |
- node_js: "9" | ||
- node_js: "7" | ||
- node_js: "iojs" | ||
- env: KARMA=true TEST=false |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
const requireAll = requireContext => requireContext.keys().forEach(requireContext); | ||
|
||
if (typeof window !== 'undefined') { | ||
requireAll(require.context('./_helpers', true, /.jsx?$/)); | ||
requireAll(require.context('.', true, /.jsx?$/)); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,8 @@ import { | |
const requiredProps = { | ||
onDatesChange: () => {}, | ||
onFocusChange: () => {}, | ||
startDateId: 'startDate', | ||
endDateId: 'endDate', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. required |
||
}; | ||
|
||
describe('DateRangePicker', () => { | ||
|
@@ -316,7 +318,6 @@ describe('DateRangePicker', () => { | |
const wrapper = shallow(( | ||
<DateRangePicker | ||
{...requiredProps} | ||
onDateChange={sinon.stub()} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not used; also |
||
onFocusChange={sinon.stub()} | ||
keepFocusOnInput | ||
/> | ||
|
@@ -330,7 +331,6 @@ describe('DateRangePicker', () => { | |
const wrapper = shallow(( | ||
<DateRangePicker | ||
{...requiredProps} | ||
onDateChange={sinon.stub()} | ||
onFocusChange={sinon.stub()} | ||
keepFocusOnInput | ||
withFullScreenPortal | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,7 +117,7 @@ describe('DayPickerKeyboardShortcuts', () => { | |
}); | ||
|
||
afterEach(() => { | ||
openKeyboardShortcutsPanelStub.reset(); | ||
openKeyboardShortcutsPanelStub.resetHistory(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
}); | ||
|
||
it('onClick calls onShowKeyboardShortcutsButtonClick', () => { | ||
|
@@ -205,9 +205,9 @@ describe('DayPickerKeyboardShortcuts', () => { | |
}); | ||
|
||
afterEach(() => { | ||
closeKeyboardShortcutsPanelStub.reset(); | ||
event.stopPropagation.reset(); | ||
event.preventDefault.reset(); | ||
closeKeyboardShortcutsPanelStub.resetHistory(); | ||
event.stopPropagation.resetHistory(); | ||
event.preventDefault.resetHistory(); | ||
}); | ||
|
||
it('onClick calls onShowKeyboardShortcutsButtonClick', () => { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather use Mocha's
--exclude
option (mochajs/mocha#3210) once it lands instead of this.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mocha has dropped older node versions so we shouldn’t be upgrading too far on it; this approach is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough 👍
Edit: Just checking. Mocha supports
node >= 4
. react-dates has dependencies that only supportnode >= 4
as well (enzyme-adapter-react-helper
>install-peerdeps
>has-yarn
) - which is causing the iojs tests to fail https://travis-ci.org/airbnb/react-dates/jobs/363589154#L4426).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is true; but that is something i'm still working on fixing :-)