File tree Expand file tree Collapse file tree 3 files changed +61
-0
lines changed
e2e-tests/development-runtime
cypress/integration/functionality Expand file tree Collapse file tree 3 files changed +61
-0
lines changed Original file line number Diff line number Diff line change 11const TEST_ELEMENT = `test-element`
22
3+ after ( ( ) => {
4+ cy . exec ( `npm run reset` )
5+ } )
6+
7+ after ( ( ) => {
8+ cy . exec ( `npm run reset` )
9+ } )
10+
311describe ( `babelrc` , ( ) => {
412 it ( `Applies .babelrc` , ( ) => {
513 cy . visit ( `/babelrc/base/` ) . waitForRouteChange ( )
@@ -8,4 +16,24 @@ describe(`babelrc`, () => {
816 . invoke ( `text` )
917 . should ( `eq` , `babel-rc-is-used` )
1018 } )
19+
20+ describe ( `hot reload` , ( ) => {
21+ it ( `editing .babelrc` , ( ) => {
22+ cy . visit ( `/babelrc/edit/` ) . waitForRouteChange ( )
23+
24+ cy . getTestElement ( TEST_ELEMENT )
25+ . invoke ( `text` )
26+ . should ( `eq` , `babel-rc-initial` )
27+
28+ cy . exec (
29+ `npm run update -- --file src/pages/babelrc/edit/.babelrc --replacements "babel-rc-initial:babel-rc-edited" --exact`
30+ )
31+
32+ cy . waitForHmr ( )
33+
34+ cy . getTestElement ( TEST_ELEMENT )
35+ . invoke ( `text` )
36+ . should ( `eq` , `babel-rc-edited` )
37+ } )
38+ } )
1139} )
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-initial</ code > first and
8+ after edit it should contain < code > babel-rc-edited</ code >
9+ </ p >
10+ < pre data-testid = "test-element" > babel-rc-test</ pre >
11+ </ >
12+ )
13+ }
You can’t perform that action at this time.
0 commit comments