Published
Edited
May 10, 2020
1 fork
Importers
1 star
Insert cell
Insert cell
test('Addition', () => {
expect(1 + 2).toBe(3)
})
Insert cell
test('Array.push() and pop()', () => {
const array = [1, 2, 3]
// push
array.push(4)
expect(array).toStrictEqual([1, 2, 3, 4])
// pop
expect(array.pop()).toBe(4)
expect(array).toStrictEqual([1, 2, 3])
})
Insert cell
Insert cell
function fixture() {
return [1, 2, 3]
}
Insert cell
test('Addition with pre-defined data', () => {
const data = fixture()
expect(data.reduce((a, b) => a + b)).toBe(1 + 2 + 3)
})
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more