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

ember-cli-blueprint-test-helpers

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-cli-blueprint-test-helpers

Blueprint test helpers for ember-cli. Mocks ember-cli for generate and destroy commands.

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.7K
decreased by-5.17%
Maintainers
1
Weekly downloads
 
Created
Source

ember-cli-blueprint-test-helpers

About

ember-cli-blueprint-test-helpers contains several test helpers for testing blueprints.

Usage

Install ember-cli-blueprint-test-helpers

Generate a blueprint test scaffold, which will also install ember-cli-blueprint-test-helpers: ember g blueprint-test my-blueprint

Setup a blueprint test with a timeout as well as before, after, beforeEach, and afterEach hooks:

describe('Acceptance: ember generate', function() {
  // pass in test instance, and timeout duration (default 20000), and the tmp environment
  setupTestHooks(this, 20000, tmpenv);
  

Use generate, destroy, or generateAndDestroy to run a test.

All three methods take the following signature: commandArgs (array), options (object)

The commandArgs should contain any commandline properties and options that would be passed to a generate or destroy command.

The options should contain a files object, as well as any of the following options:

  • usePods (boolean),
  • podModulePrefix (string)
  • target (string) ('app', 'addon', 'inRepoAddon')
  • files (array) (object: {file (string): 'path-to-file', contains (array): ['file contents to compare']})
  • beforeGenerate (function)
  • afterGenerate (function)
  • beforeDestroy (function)
  • afterDestroy (function)
var EOL                = require('os').EOL;
var tmpenv             = require('ember-cli-blueprint-test-helpers/lib/helpers/tmp-env');
var BlueprintHelpers   = require('ember-cli-blueprint-test-helpers/lib/helpers/blueprint-helper');
var generateAndDestroy = BlueprintHelpers.generateAndDestroy
...
  setupTestHooks(this, 20000, tmpenv);

  it('blueprint test', function() {
    return generateAndDestroy(['my-blueprint', 'foo'], {
      files: [
        {
          file: 'path/to/file.js',
          contents: [
            'file contents to match',
            'more file contents' + EOL
          ]
        }
      ]
    });
  });

Use EOL for line breaks, as it provides cross platform support.

Keywords

FAQs

Package last updated on 09 Oct 2015

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