Simplifies the testing of UI components by providing an elegant, fluent interface for arranging test setups along with a number of runtime debug/test helpers.
MIT License
40
stars
27
forks
source link
waitForElement throws in context of pal-nodejs #83
What is the expected behavior?
waitForElement returns an element when using Jest to run tests.
What is the motivation / use case for changing the behavior?
I'm not sure what would the correct fix be for this one.
If wait should use PAL.global.window.NodeList
of Pal Nodejs should somehow globalize NodeList.
Would be happy to provide a PR with a bit of guidance on this one
a workaround i found is to change the line to
var found = element !== null && (!(element instanceof global.window.NodeList) &&
in dist/commonjs/wait.js (depends on module system in use, I guess)
I'm submitting a bug report
Please tell us about your environment:
Operating System: Windows 10
Node Version: 8.9.4
NPM Version: yarn 1.3.2
Language: all
Current behavior: https://github.com/aurelia/testing/blob/b0fb939fa40f1067ac72d84c7775088f8b8068a6/src/wait.ts#L27 When tests are run with jest there is no instanceof NodeList. It is though under global.window, not under global though. So even though the element is successfully found by waitForElement - it is not returned.
What is the expected behavior? waitForElement returns an element when using Jest to run tests.
What is the motivation / use case for changing the behavior?
I'm not sure what would the correct fix be for this one. If wait should use PAL.global.window.NodeList of Pal Nodejs should somehow globalize NodeList.
Would be happy to provide a PR with a bit of guidance on this one
a bit of previous discussion here: https://github.com/aurelia/cli/issues/822
a workaround i found is to change the line to var found = element !== null && (!(element instanceof global.window.NodeList) && in dist/commonjs/wait.js (depends on module system in use, I guess)