Skip to content
Permalink
Browse files
tests: Add output to tests
  • Loading branch information
MichaelDeBoey committed May 11, 2020
1 parent 93374cd commit 7133483a22171caf9d6b3877f150f48a0a0604fe
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
@@ -58,6 +58,7 @@ export default {
{message: 'Use "Array<string[]>", not "string[][]"'},
{message: 'Use "Array<string>", not "string[]"'},
],
output: 'type X = Array<string[]>',
},
{
code: 'type X = Promise<{\n foo: string,\n bar: number\n}>[]',
@@ -5,6 +5,7 @@ export default {
errors: [
{message: 'All indexers must be declared with key name.'},
],
output: 'type foo = { [key: string]: number };',
},
],
valid: [
@@ -66,6 +66,7 @@ export default {
options: [
'always',
],
output: '// @flow\na;'
},
{
code: '/* @flow */',
@@ -80,6 +81,7 @@ export default {
annotationStyle: 'line',
},
],
output: '// @flow',
},
{
code: '// @flow',
@@ -94,6 +96,7 @@ export default {
annotationStyle: 'block',
},
],
output: '/* @flow */',
},
{
code: '// @flow',
@@ -108,6 +111,7 @@ export default {
annotationStyle: 'block',
},
],
output: '/* @flow */',
},
{
code: '// @flow',
@@ -123,6 +127,7 @@ export default {
strict: true,
},
],
output: '// @flow strict',
},
{
code: '/* @noflow */',
@@ -137,6 +142,7 @@ export default {
annotationStyle: 'line',
},
],
output: '// @noflow',
},
{
code: '// @noflow',
@@ -151,6 +157,7 @@ export default {
annotationStyle: 'block',
},
],
output: '/* @noflow */',
},
{
code: 'a;',
@@ -3,44 +3,53 @@ export default {
{
code: 'type FooType = { a: number, c: number, b: string }',
errors: [{message: 'Expected type annotations to be in ascending order. "b" should be before "c".'}],
output: 'type FooType = { a: number, b: string, c: number }',
},
{
code: 'type FooType = { a: number, b: number, C: number }',
errors: [{message: 'Expected type annotations to be in ascending order. "C" should be before "b".'}],
output: 'type FooType = { C: number, a: number, b: number }',
},
{
code: 'type FooType = { 1: number, 2: number, 10: number }',
errors: [{message: 'Expected type annotations to be in ascending order. "10" should be before "2".'}],
output: 'type FooType = { 1: number, 10: number, 2: number }',
},
{
code: 'type FooType = { a: number, b: number }',
errors: [{message: 'Expected type annotations to be in descending order. "b" should be before "a".'}],
options: ['desc'],
output: 'type FooType = { b: number, a: number }',
},
{
code: 'type FooType = { C: number, b: number, a: string }',
errors: [{message: 'Expected type annotations to be in descending order. "b" should be before "C".'}],
options: ['desc'],
output: 'type FooType = { b: number, a: string, C: number }',
},
{
code: 'type FooType = { 10: number, 2: number, 1: number }',
errors: [{message: 'Expected type annotations to be in descending order. "2" should be before "10".'}],
options: ['desc'],
output: 'type FooType = { 2: number, 10: number, 1: number }',
},
{
code: 'type FooType = { a: number, c: number, C: number, b: string }',
errors: [{message: 'Expected type annotations to be in insensitive ascending order. "b" should be before "C".'}],
options: ['asc', {caseSensitive: false}],
output: 'type FooType = { a: number, b: string, c: number, C: number }',
},
{
code: 'type FooType = { a: number, C: number, c: number, b: string }',
errors: [{message: 'Expected type annotations to be in insensitive ascending order. "b" should be before "c".'}],
options: ['asc', {caseSensitive: false}],
output: 'type FooType = { a: number, b: string, C: number, c: number }',
},
{
code: 'type FooType = { 1: number, 10: number, 2: boolean }',
errors: [{message: 'Expected type annotations to be in natural ascending order. "2" should be before "10".'}],
options: ['asc', {natural: true}],
output: 'type FooType = { 1: number, 2: boolean, 10: number }',
},
{
code: 'type FooType = { a: number, c: number, b: string }',

0 comments on commit 7133483

Please sign in to comment.