- Install:
- jest:
npm install --save-dev jest - ts-jest:
npm install --save-dev ts-jest @types/jest
- Modify package.json
"transform": {
"^.+\\.tsx?$": "ts-jest"
},
| module.exports = { | |
| projects: [ | |
| { | |
| displayName: 'dom', | |
| testEnvironment: 'jsdom', | |
| snapshotSerializers: ['enzyme-to-json/serializer'], | |
| testMatch: ['**/__tests__/**/*.test.js?(x)'] | |
| }, | |
| { | |
| displayName: 'node', |
| 0bdd1dad7dae9158fdb9258c289ffbd4972792e444461257649d3c7a675024661e41e5937838f66b6ab22ad2f98f06dc5de35508d5c6a9274ec61c6b4b656b31 |
| window.__testCleanup = () => { | |
| const unregisterSW = () => { | |
| return navigator.serviceWorker.getRegistrations() | |
| .then((registrations) => { | |
| const unregisterPromise = registrations.map((registration) => { | |
| return registration.unregister(); | |
| }); | |
| return Promise.all(unregisterPromise); | |
| }); | |
| }; |
| /** | |
| Usage (the label is required) | |
| <input id="uid" type="checkbox" ... /><label for="uid">Label</label> | |
| Produces styled checkboxes in IE9+, current Firefox and Chrome | |
| Demo here: http://jsfiddle.net/7Fggq/ | |
| @author Bryan Elliott <[email protected]> | |
| */ |
| #!/bin/bash | |
| libs=( "/usr/local/lib/libmacfuse_i32.2.dylib" \ | |
| "/usr/local/lib/libosxfuse_i32.2.dylib" \ | |
| "/usr/local/lib/libosxfuse_i64.2.dylib" \ | |
| "/usr/local/lib/libmacfuse_i64.2.dylib" \ | |
| "/usr/local/lib/libosxfuse_i32.la" \ | |
| "/usr/local/lib/libosxfuse_i64.la" \ | |
| "/usr/local/lib/pkgconfig/osxfuse.pc" ) |
| #!/usr/bin/env ruby | |
| # | |
| # Homebrew fix 1 - osxfuse dylibs | |
| # | |
| # original solutions: https://gist.github.com/aaronzirbes/3239033 | |
| # https://gist.github.com/trinitronx/5437061 | |
| # | |
| # Fixes the following: | |
| # | |
| # > Warning: Unbrewed dylibs were found in /usr/local/lib. |
| $base-font-size:16px; | |
| @mixin base-10-rem($property, $values...) { | |
| $length:length($values); | |
| $base-value:10px; | |
| $px-values:""; | |
| $rem-values:""; | |
| @for $i from 1 through $length { | |
| $tmp:$base-value * nth($values, $i); |
| // Straightforward + simple. | |
| $("button").on("click", function(event) { | |
| event.preventDefault(); | |
| var button = $(this); | |
| var numberElem = button.find(".number"); | |
| var number = Number(numberElem.text()) - 1; | |
| numberElem.text(number); | |
| if (number === 0) { | |
| button.prop("disabled", true); | |
| button.off("click"); |