Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@live-codes/browser-jest

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@live-codes/browser-jest

Run Jest in the browser

latest
Source
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

Jest in Browser

This project aims to make Jest work in the browser. As used in LiveCodes.

Usage

ESM:

import {
  afterAll,
  afterEach,
  beforeAll,
  beforeEach,
  describe,
  fdescribe,
  xdescribe,
  it,
  test,
  fit,
  xtest,
  xit,
  expect,
  jest,
  run,
} from 'https://unpkg.com/@live-codes/browser-jest';

test.each([
  [1, 1, 2],
  [1, 2, 3],
  [2, 1, 3],
])('.add(%i, %i)', (a, b, expected) => {
  expect(a + b).toBe(expected);
});

test('adds 1 + 2 to equal 3', () => {
  expect(1 + 2).toBe(3);
});

run().then((results) => {
  console.log(results);
});

UMD:

<script src="https://unpkg.com/@live-codes/browser-jest/dist/browser-jest.umd.js"></script>
<script>
  const {
    afterAll,
    afterEach,
    beforeAll,
    beforeEach,
    describe,
    fdescribe,
    xdescribe,
    it,
    test,
    fit,
    xtest,
    xit,
    expect,
    jest,
    run,
  } = window.browserJest;
</script>

FAQs

Package last updated on 16 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts