0.0.10 • Published 6 years ago

@unic/estatico-qunit v0.0.10

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
6 years ago

@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.

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago