Skip to content

Commit

Permalink
Override describe to handle CoffeeScript implicit returns
Browse files Browse the repository at this point in the history
CoffeeScript implicit `return`s trigger a warning since `describe` [should not](jestjs/jest#7852) `return` a value.
  • Loading branch information
danielbayley committed Jul 6, 2019
1 parent 5315378 commit 16b1f36
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cakefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ task 'generate', "Generate Jest preset JSON config.", =>
testPathIgnorePatterns: ['node_modules', 'fixtures']
transform: [glob]: package_json.name
mapCoverage: true
setupFilesAfterEnv: ['./index']

package_json.jest.transform = [glob]: './index'
fs.writeFileSync 'package.json', JSON.stringify package_json, null, 2
Expand Down
5 changes: 5 additions & 0 deletions index.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@ exports.process = (source, file) =>
presets: ['jest']

compile source, { bare: true, inlineMap: true, transpile }

if describe?
override = describe
# coffeelint: disable=no_backticks FIXME
`describe = (name, fn) => override (name, () => { fn() })`

0 comments on commit 16b1f36

Please sign in to comment.