From e777e660ad5ce8c08cfe7c1679486b649e3282dd Mon Sep 17 00:00:00 2001 From: Daniel Bayley Date: Wed, 13 Sep 2017 17:14:42 +0100 Subject: [PATCH] Initial commit --- .gitignore | 11 +++++++++ LICENSE.md | 21 ++++++++++++++++++ README.md | 35 +++++++++++++++++++++++++++++ package.json | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 130 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE.md create mode 100644 README.md create mode 100644 package.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5881593 --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +# macOS +.DS_Store + +# npm +node_modules/ +npm* +*lock* +*.log + +*.js +jest-preset.json diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..757d9da --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) +===================== +Copyright © 2017 [Daniel Bayley](https://github.com/danielbayley) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..15f4814 --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +[_Jest_] + [CoffeeScript] +========================= +Easily write your [_Jest_]s in CoffeeScript. + +Automatically handles [_transform_]ation, including even tests written in _[literate]_ CoffeeScript. + +This will work on any `.`\[[`lit`]\][`coffee`]\[[`.md`]\] file in your `test`[`s`] folder by default. + +Install +------- +`npm install jest-preset-coffeescript --save-dev`, then add the following to your `package.json`: +~~~ json +"jest": { + "transform": { + "coffee": "jest-preset-coffeescript" + } +}, +~~~ + +License +------- +[MIT] © [Daniel Bayley] + +[MIT]: LICENSE.md +[Daniel Bayley]: https://github.com/danielbayley + +[_jest_]: https://facebook.github.io/jest +[_transform_]: https://facebook.github.io/jest/docs/en/configuration.html#transform-object-string-string + +[coffeescript]: http://coffeescript.org +[literate]: http://coffeescript.org/#literate + +[`lit`]: test/index.litcoffee +[`coffee`]: test/index.coffee +[`.md`]: test/index.coffee.md diff --git a/package.json b/package.json new file mode 100644 index 0000000..5feb201 --- /dev/null +++ b/package.json @@ -0,0 +1,63 @@ +{ + "name": "jest-preset-coffeescript", + "version": "0.0.0", + "description": "Easily write your Jests in CoffeeScript.", + "keywords": [ + "coffee", + "coffeescript", + "jest", + "preset", + "transform", + "config", + "unit", + "test" + ], + "homepage": "https://github.com/danielbayley/jest-preset-coffeescript#readme", + "repository": "danielbayley/jest-preset-coffeescript", + "bugs": "https://github.com/danielbayley/jest-preset-coffeescript/issues", + "author": "Daniel Bayley (https://github.com/danielbayley)", + "license": "MIT", + "devDependencies": { + "@danielbayley/fabric": "<2", + "coffeelint": "^1.16.0", + "coffeescript": "^2.0.0-beta5", + "husky": "^0.14.3", + "jest": "^21.1.0", + "lint-staged": "^4.2.1", + }, + "peerDependencies": { + "coffeescript": "*", + "jest": "*" + }, + "files": [ + "*.js*" + ], + "lint-staged": { + "{*.*coffee*,Cakefile}": [ + "coffeelint", + "jest --bail --findRelatedTests" + ] + }, + "coffeelintConfig": { + "extends": "@danielbayley/fabric/coffeelint" + }, + "jest": { + "verbose": true, + "preset": "./jest-preset.json", + "transform": { + "coffee": "./index" + } + }, + "scripts": { + "compile": "npm run compile.coffee", + "compile.coffee": "coffee -cb *.coffee", + "prepare": "npm run compile", + "precommit": "lint-staged", + "pretest": "npm run prepare", + "test": "npm run test.lint && npm run test.jest", + "test.lint": "npm run test.lint.coffee", + "test.lint.coffee": "coffeelint --cache -- {test/,}*.*coffee* Cakefile", + "test.jest": "jest --onlyChanged", + "clean": "rm *.js jest-preset.json" + } +}