Skip to content

Commit

Permalink
Prettier likes parens a lot now
Browse files Browse the repository at this point in the history
git blame is now broken forever.
  • Loading branch information
adamwathan committed Oct 16, 2020
1 parent 8e4e0a0 commit 38b4eeb
Show file tree
Hide file tree
Showing 69 changed files with 365 additions and 366 deletions.
3 changes: 1 addition & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
"useTabs": false,
"trailingComma": "es5",
"bracketSpacing": true,
"parser": "flow",
"arrowParens": "avoid"
"parser": "flow"
}
]
}
Expand Down
30 changes: 15 additions & 15 deletions __tests__/applyAtRule.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function run(input, config = {}) {
test('it copies the declarations from a class into itself', () => {
const output = '.a { color: red; } .b { color: red; }'

return run('.a { color: red; } .b { @apply .a; }').then(result => {
return run('.a { color: red; } .b { @apply .a; }').then((result) => {
expect(result.css).toMatchCss(output)
expect(result.warnings().length).toBe(0)
})
Expand All @@ -25,7 +25,7 @@ test('selectors with invalid characters do not need to be manually escaped', ()
.b { color: red; }
`

return run(input).then(result => {
return run(input).then((result) => {
expect(result.css).toMatchCss(expected)
expect(result.warnings().length).toBe(0)
})
Expand All @@ -42,7 +42,7 @@ test('it removes important from applied classes by default', () => {
.b { color: red; }
`

return run(input).then(result => {
return run(input).then((result) => {
expect(result.css).toMatchCss(expected)
expect(result.warnings().length).toBe(0)
})
Expand All @@ -59,7 +59,7 @@ test('applied rules can be made !important', () => {
.b { color: red !important; }
`

return run(input).then(result => {
return run(input).then((result) => {
expect(result.css).toMatchCss(expected)
expect(result.warnings().length).toBe(0)
})
Expand All @@ -85,14 +85,14 @@ test('cssnext custom property sets are preserved', () => {
}
`

return run(input).then(result => {
return run(input).then((result) => {
expect(result.css).toMatchCss(expected)
expect(result.warnings().length).toBe(0)
})
})

test('it fails if the class does not exist', () => {
return run('.b { @apply .a; }').catch(e => {
return run('.b { @apply .a; }').catch((e) => {
expect(e).toMatchObject({ name: 'CssSyntaxError' })
})
})
Expand All @@ -108,7 +108,7 @@ test('applying classes that are defined in a media query is not supported', () =
}
`
expect.assertions(1)
return run(input).catch(e => {
return run(input).catch((e) => {
expect(e).toMatchObject({ name: 'CssSyntaxError' })
})
})
Expand All @@ -128,7 +128,7 @@ test('applying classes that are ever used in a media query is not supported', ()
}
`
expect.assertions(1)
return run(input).catch(e => {
return run(input).catch((e) => {
expect(e).toMatchObject({ name: 'CssSyntaxError' })
})
})
Expand All @@ -144,7 +144,7 @@ test('it does not match classes that include pseudo-selectors', () => {
}
`
expect.assertions(1)
return run(input).catch(e => {
return run(input).catch((e) => {
expect(e).toMatchObject({ name: 'CssSyntaxError' })
})
})
Expand All @@ -164,7 +164,7 @@ test('it does not match classes that have multiple rules', () => {
}
`
expect.assertions(1)
return run(input).catch(e => {
return run(input).catch((e) => {
expect(e).toMatchObject({ name: 'CssSyntaxError' })
})
})
Expand All @@ -178,7 +178,7 @@ test('you can apply utility classes that do not actually exist as long as they w
.foo { margin-top: 1rem; }
`

return run(input).then(result => {
return run(input).then((result) => {
expect(result.css).toMatchCss(expected)
expect(result.warnings().length).toBe(0)
})
Expand All @@ -193,7 +193,7 @@ test('you can apply utility classes without using the given prefix', () => {
.foo { margin-top: 1rem; margin-bottom: 1rem; }
`

return run(input, { prefix: 'tw-' }).then(result => {
return run(input, { prefix: 'tw-' }).then((result) => {
expect(result.css).toMatchCss(expected)
expect(result.warnings().length).toBe(0)
})
Expand All @@ -212,7 +212,7 @@ test('you can apply utility classes without using the given prefix when using a
prefix: () => {
return 'tw-'
},
}).then(result => {
}).then((result) => {
expect(result.css).toMatchCss(expected)
expect(result.warnings().length).toBe(0)
})
Expand All @@ -227,7 +227,7 @@ test('you can apply utility classes without specificity prefix even if important
.foo { margin-top: 2rem; margin-bottom: 2rem; }
`

return run(input, { important: '#app' }).then(result => {
return run(input, { important: '#app' }).then((result) => {
expect(result.css).toMatchCss(expected)
expect(result.warnings().length).toBe(0)
})
Expand All @@ -245,7 +245,7 @@ test('you can apply utility classes without using the given prefix even if impor
return run(input, {
prefix: 'tw-',
important: '#app',
}).then(result => {
}).then((result) => {
expect(result.css).toMatchCss(expected)
expect(result.warnings().length).toBe(0)
})
Expand Down
Loading

0 comments on commit 38b4eeb

Please sign in to comment.