Add test for nested ternary with arrow func (#3039)

master
Brian Ng 2017-10-15 17:09:57 -05:00 committed by Lucas Azzola
parent 3c5dae3702
commit d90aec1a1d
4 changed files with 31 additions and 4 deletions

View File

@ -15,7 +15,7 @@
},
"dependencies": {
"babel-code-frame": "7.0.0-alpha.12",
"babylon": "7.0.0-beta.23",
"babylon": "7.0.0-beta.28",
"camelcase": "4.1.0",
"chalk": "2.1.0",
"cjk-regex": "1.0.1",

View File

@ -92,6 +92,30 @@ aaaaaaaaaaaaaaa
`;
exports[`nested.js 1`] = `
let icecream = what == "cone"
? p => !!p ? \`here's your \${p} cone\` : \`just the empty cone for you\`
: p => \`here's your \${p} \${what}\`;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
let icecream =
what == "cone"
? p => (!!p ? \`here's your \${p} cone\` : \`just the empty cone for you\`)
: p => \`here's your \${p} \${what}\`;
`;
exports[`nested.js 2`] = `
let icecream = what == "cone"
? p => !!p ? \`here's your \${p} cone\` : \`just the empty cone for you\`
: p => \`here's your \${p} \${what}\`;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
let icecream =
what == "cone"
? p => (!!p ? \`here's your \${p} cone\` : \`just the empty cone for you\`)
: p => \`here's your \${p} \${what}\`;
`;
exports[`parenthesis.js 1`] = `
debug ? this.state.isVisible ? "partially visible" : "hidden" : null;
debug ? this.state.isVisible && somethingComplex ? "partially visible" : "hidden" : null;

View File

@ -0,0 +1,3 @@
let icecream = what == "cone"
? p => !!p ? `here's your ${p} cone` : `just the empty cone for you`
: p => `here's your ${p} ${what}`;

View File

@ -800,9 +800,9 @@ babel-types@^6.26.0:
lodash "^4.17.4"
to-fast-properties "^1.0.3"
babylon@7.0.0-beta.23:
version "7.0.0-beta.23"
resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.23.tgz#c7e8e7a389b6f6c6212ceac1a3905c7e73d7e45a"
babylon@7.0.0-beta.28:
version "7.0.0-beta.28"
resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.28.tgz#14521f26a19918db2b5f4aca89e62e02e0644be7"
babylon@^6.13.0, babylon@^6.17.2:
version "6.17.3"