@unic/estatico-qunit

0.0.10 • Public • Published

@unic/estatico-qunit [Deprecated]

Helpers for QUnit tests

Installation

$ npm install --save-dev @unic/estatico-qunit

Usage

Add the following config to the estatico-puppeteer's options:

{
  plugins: {
    interact: async (page) => {
      // Run tests
      const results = await require('@unic/estatico-qunit').puppeteer.run(page);

      // Report results
      if (results) {
        require('@unic/estatico-qunit').puppeteer.log(results, {
          info: console.log,
        });
      }
    },
  },
};

Include test script in src/preview/assets/js/main.js, e.g.:

import '@unic/estatico-qunit/lib/browser';

Add the following config to the estatico-handlebars's options to provide the qunit helper below:

{
  plugins: {
    handlebars: {
      helpers: {
        register: () => {
          handlebars.registerHelper('qunit', require('@unic/estatico-qunit').handlebarsHelper(handlebars));
        },
      }
    },
  },
};

Use helper in src/preview/partials/test.hbs, e.g.:

{{{qunit mainTestScript="/preview/assets/js/test.js" testScripts=meta.testScripts}}}

License

Apache 2.0.

Readme

Keywords

none

Package Sidebar

Install

npm i @unic/estatico-qunit

Weekly Downloads

2

Version

0.0.10

License

Apache-2.0

Unpacked Size

4.8 kB

Total Files

7

Last publish

Collaborators

  • team-unic
  • backflip
  • oriol.tf
  • rbnlffl
  • lbsonley