New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bootprint-unit-testing

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bootprint-unit-testing

Unit-testing-tools for bootprint-projects

  • 4.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
17
increased by1600%
Maintainers
1
Weekly downloads
 
Created
Source

bootprint-unit-testing

NPM version Travis Build Status Coverage Status

Unit-testing-tools for bootprint-projects

Installation

npm install bootprint-unit-testing

Usage

Consider a bootprint-module that uses the following Handlebarse-template as index.html.hbs

<body>
<p>name: {{name}}</p>
</body>

A test can be written like this:

/*!
 * bootprint-unit-testing <https://github.com/bootprint/bootprint-unit-testing>
 *
 * Copyright (c) 2017 Nils Knappmeier.
 * Released under the MIT license.
 */

/* eslint-env mocha */

'use strict'

const expect = require('chai').expect
const core = require('bootprint-unit-testing')(require('./module.js'), __dirname)

describe('The bootprint-unit-testing module', function() {
  this.timeout(10000)
  const context = {}
  before(function() {
    return core.run({ name: 'Nils' }, context)
  })

  it('The output should contain the name in a <p>-tag', function() {
    expect(context.$('p').html()).to.contain('Nils')
  })
})

The test will run bootprint with the given module and verify the generated HTML using the cheerio library.

Trace and clarify activated


  The bootprint-unit-testing module
    ✓ The output should contain the name in a <p>-tag


  1 passing (171ms)

License

bootprint-unit-testing is published under the MIT-license.

See LICENSE.md for details.

Release-Notes

For release notes, see CHANGELOG.md

Contributing guidelines

See CONTRIBUTING.md.

FAQs

Package last updated on 27 Jan 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc