🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

@unic/estatico-qunit

Package Overview
Dependencies
Maintainers
5
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@unic/estatico-qunit

Helpers for QUnit tests

latest
Source
npmnpm
Version
0.0.10
Version published
Maintainers
5
Created
Source

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

FAQs

Package last updated on 01 Nov 2018

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