1.1.5 ā€¢ Published 5 years ago

iwork v1.1.5

Weekly downloads
16
License
MIT
Repository
github
Last release
5 years ago

<developer>: Hey code, are you broken?<code>: I work<developer>: prove it!<code>: hold my beer šŸŗ

  • A micro testing framework for the browser. Only 2.1Kb.
  • Bare minimum API (describe, it, run and HTML reporter)

šŸ¤˜ Demo

Why I've made it

  • There are not so many options for running tests client-side.
  • I needed something simple as setup which I have full control of. And by control I mean (a) when and how to run the tests and (b) when and how to display the results of the tests. Frameworks like Mocha for example make some assumptions on the content of your page and are not so flexible in terms of rendering the test results.

Setup

  • <script src="https://unpkg.com/iwork"></script>
  • yarn install iwork
  • Use iwork.min.js directly

Example:

<script src="https://unpkg.com/iwork"></script>
<script>
  const { describe, it, run, reporters } = iwork();

  describe('Given something', () => {
    describe('when something is changed', () => {
      it('then it should work', () => {
        expect(1).toBe(1);
      });
    });
  });

  run().then(report => {
    document.querySelector('#output').innerHTML = reporters.html(report);
  });
</script>

Notice that iwork does not come with assertion library. The example above uses expect which I got from here. It works in the browser too from this URL.

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago