jest-store-log

Simple one class library to for storing the console output with jest

Usage no npm install needed!

<script type="module">
  import jestStoreLog from 'https://cdn.skypack.dev/jest-store-log';
</script>

README

npmV min install githubLastCommit codecov circleci

Usage

test('TEST', () => {
  const log = new JestStoreLog();

  // test console.log
  console.log('hello world');
  expect(log.data).toBe(`hello world`);

  log.TestEnd(); // IMPORTANT call TestEnd at the end of your test.
});

License

Copyright (c) 2020 Leonard Grosoli Licensed under the MIT license.