Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Meta
create-react-app
Commits
946d1ad4
Unverified
Commit
946d1ad4
authored
6 years ago
by
Joe Haddad
Browse files
Options
Download
Email Patches
Plain Diff
Test flow types are stripped before class properties are transformed
parent
70b3110a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
fixtures/smoke/issue-5176-flow-class-properties/index.test.js
+13
-0
...ures/smoke/issue-5176-flow-class-properties/index.test.js
fixtures/smoke/issue-5176-flow-class-properties/package.json
+1
-0
fixtures/smoke/issue-5176-flow-class-properties/package.json
fixtures/smoke/issue-5176-flow-class-properties/src/App.js
+12
-0
fixtures/smoke/issue-5176-flow-class-properties/src/App.js
fixtures/smoke/issue-5176-flow-class-properties/src/App.test.js
+6
-0
...es/smoke/issue-5176-flow-class-properties/src/App.test.js
fixtures/utils.js
+16
-0
fixtures/utils.js
with
48 additions
and
0 deletions
+48
-0
fixtures/smoke/issue-5176-flow-class-properties/index.test.js
0 → 100644
+
13
-
0
View file @
946d1ad4
const
{
bootstrap
,
isSuccessfulTest
}
=
require
(
'
../../utils
'
);
beforeEach
(
async
()
=>
{
await
bootstrap
({
directory
:
global
.
testDirectory
,
template
:
__dirname
});
});
describe
(
'
issue #5176 (flow class properties interaction)
'
,
()
=>
{
it
(
'
passes tests
'
,
async
()
=>
{
await
isSuccessfulTest
({
directory
:
global
.
testDirectory
,
jestEnvironment
:
'
node
'
,
});
});
});
This diff is collapsed.
Click to expand it.
fixtures/smoke/issue-5176-flow-class-properties/package.json
0 → 100644
+
1
-
0
View file @
946d1ad4
{}
This diff is collapsed.
Click to expand it.
fixtures/smoke/issue-5176-flow-class-properties/src/App.js
0 → 100644
+
12
-
0
View file @
946d1ad4
class
App
{
constructor
(
props
)
{
super
(
props
);
this
.
foo
=
this
.
foo
.
bind
(
this
);
}
foo
:
void
=>
void
;
foo
()
{
return
'
bar
'
;
}
}
export
default
App
;
This diff is collapsed.
Click to expand it.
fixtures/smoke/issue-5176-flow-class-properties/src/App.test.js
0 → 100644
+
6
-
0
View file @
946d1ad4
import
App
from
'
./App
'
;
it
(
'
creates instance without
'
,
()
=>
{
const
app
=
new
App
();
expect
(
app
.
foo
()).
toBe
(
'
bar
'
);
});
This diff is collapsed.
Click to expand it.
fixtures/utils.js
+
16
-
0
View file @
946d1ad4
...
@@ -67,6 +67,21 @@ async function isSuccessfulProduction({ directory }) {
...
@@ -67,6 +67,21 @@ async function isSuccessfulProduction({ directory }) {
}
}
}
}
async
function
isSuccessfulTest
({
directory
,
jestEnvironment
=
'
jsdom
'
})
{
const
{
status
,
stdout
,
stderr
}
=
await
execa
(
'
./node_modules/.bin/react-scripts
'
,
[
'
test
'
,
'
--env
'
,
jestEnvironment
,
'
--ci
'
],
{
cwd
:
directory
,
env
:
{
CI
:
'
true
'
},
}
);
if
(
status
!==
0
)
{
throw
new
Error
(
`stdout:
${
stdout
}${
os
.
EOL
+
os
.
EOL
}
stderr:
${
stderr
}
`
);
}
}
async
function
getOutputDevelopment
({
directory
,
env
=
{}
})
{
async
function
getOutputDevelopment
({
directory
,
env
=
{}
})
{
try
{
try
{
const
{
stdout
,
stderr
}
=
await
execa
(
const
{
stdout
,
stderr
}
=
await
execa
(
...
@@ -128,6 +143,7 @@ module.exports = {
...
@@ -128,6 +143,7 @@ module.exports = {
bootstrap
,
bootstrap
,
isSuccessfulDevelopment
,
isSuccessfulDevelopment
,
isSuccessfulProduction
,
isSuccessfulProduction
,
isSuccessfulTest
,
getOutputDevelopment
,
getOutputDevelopment
,
getOutputProduction
,
getOutputProduction
,
};
};
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment