File tree Expand file tree Collapse file tree 3 files changed +53
-0
lines changed
e2e-tests/development-runtime
cypress/integration/functionality Expand file tree Collapse file tree 3 files changed +53
-0
lines changed Original file line number Diff line number Diff line change @@ -8,4 +8,24 @@ describe(`babelrc`, () => {
88 . invoke ( `text` )
99 . should ( `eq` , `babel-rc-is-used` )
1010 } )
11+
12+ describe ( `hot reload` , ( ) => {
13+ it ( `editing .babelrc` , ( ) => {
14+ cy . visit ( `/babelrc/edit/` ) . waitForRouteChange ( )
15+
16+ cy . getTestElement ( TEST_ELEMENT )
17+ . invoke ( `text` )
18+ . should ( `eq` , `babel-rc-initial` )
19+
20+ cy . exec (
21+ `npm run update -- --file src/pages/babelrc/edit/index.js --replacements "babel-rc-test:babel-rc-edited" --exact`
22+ )
23+
24+ cy . waitForHmr ( )
25+
26+ cy . getTestElement ( TEST_ELEMENT )
27+ . invoke ( `text` )
28+ . should ( `eq` , `babel-rc-edited` )
29+ } )
30+ } )
1131} )
Original file line number Diff line number Diff line change 1+ {
2+ "plugins" : [
3+ [
4+ " babel-plugin-search-and-replace" ,
5+ {
6+ "rules" : [
7+ {
8+ "search" : " babel-rc-test" ,
9+ "replace" : " babel-rc-initial" ,
10+ "searchTemplateStrings" : true
11+ }
12+
13+ ]
14+ }
15+ ]
16+ ],
17+ "presets" : [
18+ " babel-preset-gatsby"
19+ ]
20+ }
Original file line number Diff line number Diff line change 1+ import React from "react"
2+
3+ export default function BabelrcEdit ( ) {
4+ return (
5+ < >
6+ < p >
7+ Code block below should contain < code > babel-rc-edited</ code > first and
8+ after edit it should contain < code > babel-rc-edited</ code >
9+ </ p >
10+ < pre data-testid = "test-element" > babel-rc-edited</ pre >
11+ </ >
12+ )
13+ }
You can’t perform that action at this time.
0 commit comments