This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const jsc = require('jsverify') | |
// With property based testing, we don't check for specific inputs and outputs, instead we are testing the boundaries of our code. | |
const additionIsCommunative = jsc.checkForall(jsc.integer, jsc.integer, | |
(a, b) => a + b === b + a) | |
const multiplicationIsDistributive = jsc.checkForall(jsc.integer, jsc.integer, jsc.integer, | |
(a, b, c) => a * (b + c) === a * b + a * c) | |
const subtractionIsCommutative = jsc.checkForall(jsc.integer, jsc.integer, | |
(a, b) => a - b === b - a) | |
// log out whether or not the test passed | |
console.log({ additionIsCommunative, multiplicationIsDistributive, subtractionIsCommutative }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Welcome! require() some modules from npm (like you were using browserify) | |
// and then hit Run Code to run your code on the right side. | |
// Modules get downloaded from browserify-cdn and bundled in your browser. | |
var choo = require('choo') | |
var html = require('choo/html') | |
const app = choo() | |
app.model({ | |
state: { code: 'console.log("hello world");' }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Welcome! require() some modules from npm (like you were using browserify) | |
// and then hit Run Code to run your code on the right side. | |
// Modules get downloaded from browserify-cdn and bundled in your browser. | |
var choo = require('choo') | |
var html = require('choo/html') | |
const app = choo() | |
app.model({ | |
state: { code: 'console.log("hello world");' }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const choo = require('choo') | |
const html = require('choo/html') | |
const app = choo() | |
app.model({ | |
state: { title: 'Set the title' }, | |
reducers: { | |
update: (action, state) => ({ title: action.value }) | |
} | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const choo = require('choo'); | |
const html = require('choo/html'); | |
const marked = require('marked'); | |
const app = choo(); | |
app.model({ | |
namespace: 'choodown', | |
state: { | |
text: '' | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const choo = require('choo'); | |
const html = require('choo/html'); | |
const marked = require('marked'); | |
const app = choo(); | |
app.model({ | |
namespace: 'choodown', | |
state: { | |
text: '' | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const choo = require('choo'); | |
const html = require('choo/html'); | |
const marked = require('marked'); | |
const app = choo(); | |
app.model({ | |
namespace: 'choodown', | |
state: { | |
text: '' | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
atom-text-editor { | |
font-family: 'Fira Code'; | |
font-style: normal; | |
text-rendering: optimizeLegibility; | |
} | |
atom-text-editor::shadow { | |
.string.quoted, | |
.string.regexp { | |
-webkit-font-feature-settings: "liga" off, "calt" off; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sane from 'sane'; | |
import { resolve as resolvePath } from 'path'; | |
import { spawn, fork } from 'child_process'; | |
import { existsSync as fileExists} from 'fs'; | |
import { | |
red, green, yellow, blue, | |
magenta, cyan, white, gray | |
} from 'chalk'; | |
process.env.PATH += ':./node_modules/.bin'; |