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
Download the React DevTools for a better development experience: http://fb.me/react-devtools /thirdparty/react.js:4356 | |
Use brackets.getModule("thirdparty/CodeMirror2/lib/codemirror") instead of global CodeMirror. | |
at Object.defineProperty.get (/brackets.js:120:32) | |
at file:///home/memrich/.config/Brackets/extensions/user/brackets-livescript/main.js:8:7 | |
at Object.<anonymous> (file:///home/memrich/.config/Brackets/extensions/user/brackets-livescript/main.js:253:7) /utils/DeprecationWarning.js:88 | |
Use brackets.getModule("thirdparty/CodeMirror2/lib/codemirror") instead of global CodeMirror. | |
at Object.defineProperty.get (/brackets.js:120:32) | |
at Object.<anonymous> (file:///home/memrich/.config/Brackets/extensions/user/brackets-livescript/main.js:255:5) /utils/DeprecationWarning.js:88 | |
Registering for deprecated event 'currentDocumentChange'. Instead, use MainViewManager.currentFileChange. Error | |
at Object.on (/utils/EventDispatcher.js:100:43) |
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
/* bling.js */ | |
window.$ = document.querySelectorAll.bind(document); | |
Node.prototype.on = window.on = function (name, fn) { | |
this.addEventListener(name, fn); | |
} | |
NodeList.prototype.__proto__ = Array.prototype; |
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
describe('leap year specs', () => { | |
describe('A year is a leap year if', () => { | |
it('is divisible by 4 but not by 100', () => { | |
expect(isLeapYear(2016)).toBeTruthy() | |
}); | |
it('is divisible by 400', () => { | |
expect(isLeapYear(2000)).toBeTruthy() | |
}); | |
}); |
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
describe('leap year specs', () => { | |
describe('A year is a leap year if', () => { | |
it.each( | |
[2016, 1984, 4] | |
)( | |
'it is divisible by 4 but not by 100 (eg. %i)', | |
year => expect(isLeapYear(year)).toBeTruthy() | |
); | |
it.each( | |
[2400, 2000, 400] |
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 React from "react"; | |
import ReactDOM from "react-dom"; | |
import TicTacToe from './model/tic_tac_toe' | |
import {Board} from './components/board' | |
const App = document.getElementById("app"); | |
ReactDOM.render(<Board game={TicTacToe.startWithSize(3, 3)} />, App); |
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
describe('greater than in obj', () => { | |
// is the second value of the obj greater than 5? | |
const obj = {value: [5, 4]}; | |
// different Assertions/Expectations/Matcher Variants | |
it('jest equal', () => expect(obj.value[1] > 5).toBeTruthy()); | |
it('jest greater', () => expect(obj.value[1]).toBeGreaterThan(5)); | |
it('jest matchObject', () => expect(obj).toMatchObject({value: [5, 5]})); | |
it('unexpected satisfy', () => | |
unexpect(obj, 'to satisfy', {value: [5, unexpect.it('to be greater than', 4)]}) |
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
describe('GET /user', function() { | |
it('responds with json', function(done) { | |
request(app) | |
.get('/user') | |
.set('Accept', 'application/json') | |
.expect('Content-Type', /json/) | |
.expect(200, done); | |
}); | |
}); |
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
describe('Board', () => { | |
it('should have the right number of cells', () => { | |
const wrapper = shallow(<Board game={TicTacToe.startWithSize(4, 4)} />); | |
expect(wrapper.find(Cell).length).toEqual(16); | |
}); | |
}); |
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
it('should have the right number of cells', () => { | |
const { container, getAllByTestId } = render(<Board game={TicTacToe.startWithSize(4, 4)} />); | |
expect( | |
getAllByTestId("cell").length | |
).toEqual(16); | |
}); |
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
describe("...", () => { | |
it("...", () => { | |
... | |
}) | |
}); |
OlderNewer