Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
RunKit + npm: jest-lite
node v10.24.1
endpoint
share
tweet
// Define `window` to fake browser env global.window = {}; const {describe, it, expect, run} = require("jest-lite"); function sum(x, y) { return x + y; } describe('sum', () => { it('adds the two given numbers', () => { expect(sum(2, 2)).toBe(4); }); }); const result = await run(); console.log(result);
Created from: https://npm.runkit.com/jest-lite
Loading…
Clone and edit this document