Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ember-cli-custom-assertions

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-cli-custom-assertions - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

blueprints/assertion/files/tests/assertions/__name__.js

2

package.json
{
"name": "ember-cli-custom-assertions",
"version": "0.0.1",
"version": "0.0.2",
"description": "Easily add custom assertions to your Ember test suite",

@@ -5,0 +5,0 @@ "directories": {

# ember-cli-custom-assertions #
[![Build Status](https://secure.travis-ci.org/dockyard/ember-cli-custom-assertions.svg?branch=master)](http://travis-ci.org/dockyard/ember-cli-custom-assertions)
## About ##

@@ -23,3 +25,2 @@

// tests/assertions/contains.js
export default function(context, element, text, message) {

@@ -42,2 +43,13 @@ var matches = context.$(element).text().match(new RegExp(text));

*Note: hyphenated file names like `tests/assertions/double-trouble.js`
will be camelized: `assert.doubleTrouble`*
### Blueprint
You can generate a new assertion by using the `assertion` blueprint:
```
ember g assertion double-trouble
```
### Assertion

@@ -44,0 +56,0 @@

import Ember from 'ember';
import { default as environment } from '../config/environment';
const {
camelize
} = Ember.String;
let assertionCache;

@@ -7,5 +12,8 @@

if (!assertionCache) {
const { modulePrefix } = environment;
const entries = Ember.A(Object.keys(requirejs.entries));
let _assertions = entries.filter(function(entry) {
return entry.match(/^dummy\/tests\/assertions\/\w+$/);
const pattern = new RegExp(`^${modulePrefix}/tests/assertions/[\\w-]+$`);
const _assertions = entries.filter(function(entry) {
return entry.match(pattern);
});

@@ -18,2 +26,3 @@

entry = splitEntry[splitEntry.length - 1];
entry = camelize(entry);
entries[entry] = fn;

@@ -20,0 +29,0 @@

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