Released 11/27/2016
Notes:
- We've created a new example recipes repo to show you common testing scenarios including how to use the new module support.
Summary:
- We've added automatic ES2015+, module, JSX, and CJSX support to all test
files. This means you can use
require
,import
, orexport
declarations to load other files. You can also use this to import your own application specific JavaScript modules and write unit tests for them. More of these details are yet to come. See this issue. - You can now use your regularly installed
node_modules
in your project to do things like utilizinglodash
for utility functions or extendingchai
with assertion plugins. - Because we're now processing the spec files prior to handing them off to the
browser, this means we will display problems like syntax errors when something
in the processing goes wrong. Additionally, we print these out during
cypress run
, so you're not stuck wondering what went wrong.
Breaking Changes:
- Previously, we auto-magically included all files within
cypress/support
. This has now gone away and we've simplified this to automatically including a singlecypress/support/index.js
file. That single file acts as the entry point meaning you shouldimport
orrequire
the other support files you'd like to include. Although this is still "automatic" it's much less magical and we'll be updating all of our docs to reflect this. The purpose ofcypress/support
hasn't really changed, just the implementation of it has. We will automatically seed acypress/support/index.js
file for you (even on existing projects). The file location ofcypress/support/index.js
can be changed with the newsupportFile
option in yourcypress.json
. This feature can also be turned off by specifyingsupportFile: false
.
Features:
- We now support ES2015+, modules, and JSX in all spec files. Fixes #246.
- Spec files may now be written as
.js
,.jsx
,.coffee
, orcjsx
files. - Test files with JS syntax errors are now
handled and we provide a GUI that points
to the exact line/column number. Additionally we print these out during
cypress run
and exit the process withcode 1
. Fixes #293.
Misc:
- We improved the logic around when and if we scaffold files on a new project. We're much smarter about this and not generating these forcibly every time. Fixes #285.
- Simplified handling of support files and made them less "magical". Fixes #286.
- Renamed
supportFolder
tosupportFile
incypress.json
. We will automatically rename yourcypress.json
if this property was present on update.