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

behave-events

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

behave-events - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

10

grunt-tasks/6to5.js

@@ -5,3 +5,3 @@ module.exports = {

},
build: {
src: {
files: [{

@@ -13,3 +13,11 @@ expand: true,

}],
},
spec: {
files: [{
expand: true,
cwd: 'test/spec/',
src: ['*.js'],
dest: 'test/common'
}]
}
};

2

grunt-tasks/browserify.js

@@ -10,3 +10,3 @@ module.exports = {

files: {
'test/build/specs.js': ['test/spec/**/*.js']
'test/build/specs.js': ['test/common/*.js']
}

@@ -13,0 +13,0 @@ },

module.exports = {
test: ['test/build'],
test: ['test/build', 'test/common'],
dist: ['dist'],
dev: ['dev']
};

@@ -17,5 +17,5 @@ var path = require('path');

grunt.registerTask('default', ['test']);
grunt.registerTask('dev', ['browserify:dev']);
grunt.registerTask('test', ['clean:test', 'jshint', 'browserify:spec', 'jasmine']);
grunt.registerTask('build', ['clean:dist', 'jshint', '6to5']);
grunt.registerTask('dev', ['build', 'browserify:dev']);
grunt.registerTask('test', ['clean:test', 'jshint', '6to5:spec', 'browserify:spec', 'jasmine']);
grunt.registerTask('build', ['clean:dist', 'jshint', '6to5:src']);
};
{
"name": "behave-events",
"version": "0.1.1",
"version": "0.1.2",
"description": "An extended EventEmitter class with advanced event support (transactions, commands, and requests) ",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -108,2 +108,3 @@ # behave-events

- 0.1.0 Initial Release
- 0.2.0 Cleaned up examples in readme
- 0.1.1 Cleaned up examples in readme
- 0.1.2 Converted tests to ES6

@@ -1,11 +0,11 @@

var BehaveEvents = require('../../dist/index');
import BehaveEvents from '../../dist/index';
describe('BehaveEvents', function() {
beforeEach(function() {
describe('BehaveEvents', () => {
beforeEach(() => {
this.events = new BehaveEvents();
});
describe('.transaction()', function() {
describe('.transaction()', () => {
it('should be defined', function(done) {
it('should be defined', (done) => {
expect(this.events.transaction).toBeDefined();

@@ -15,4 +15,4 @@ done();

it('should register a transaction', function(done) {
var cb = function() {};
it('should register a transaction', (done) => {
var cb = () => {};
this.events.transaction('test', cb);

@@ -25,5 +25,5 @@ expect(this.events.__transactions.test).toBeDefined();

describe('.transact()', function() {
describe('.transact()', () => {
it('should be defined', function(done) {
it('should be defined', (done) => {
expect(this.events.transact).toBeDefined();

@@ -33,3 +33,3 @@ done();

it('should call a registered transaction', function(done) {
it('should call a registered transaction', (done) => {
var spy = jasmine.createSpy('transaction');

@@ -42,3 +42,3 @@ this.events.transaction('test', spy);

it('should return a promise', function(done) {
it('should return a promise', (done) => {
var spy = jasmine.createSpy('transaction');

@@ -54,5 +54,5 @@ this.events.transaction('test', spy);

describe('.stopTransacting()', function() {
describe('.stopTransacting()', () => {
it('should be defined', function(done) {
it('should be defined', (done) => {
expect(this.events.stopTransacting).toBeDefined();

@@ -62,4 +62,4 @@ done();

it('should remove a registered transaction', function(done) {
this.events.transaction('test', function() {});
it('should remove a registered transaction', (done) => {
this.events.transaction('test', () => {});
expect(this.events.__transactions.test).toBeDefined();

@@ -73,5 +73,5 @@

describe('.response()', function() {
describe('.response()', () => {
it('should be defined', function(done) {
it('should be defined', (done) => {
expect(this.events.response).toBeDefined();

@@ -81,4 +81,4 @@ done();

it('should register a response', function(done) {
var cb = function() {};
it('should register a response', (done) => {
var cb = () => {};
this.events.response('test', cb);

@@ -91,5 +91,5 @@ expect(this.events.__responses.test).toBeDefined();

describe('.request()', function() {
describe('.request()', () => {
it('should be defined', function(done) {
it('should be defined', (done) => {
expect(this.events.transact).toBeDefined();

@@ -99,3 +99,3 @@ done();

it('should call a registered response', function(done) {
it('should call a registered response', (done) => {
var spy = jasmine.createSpy('transaction');

@@ -108,4 +108,4 @@ this.events.response('test', spy);

it('should return a value from response', function(done) {
var cb = function() { return 'test'; };
it('should return a value from response', (done) => {
var cb = () => { return 'test'; };
this.events.response('test', cb);

@@ -118,5 +118,5 @@ var ret = this.events.request('test');

describe('.stopResponding()', function() {
describe('.stopResponding()', () => {
it('should be defined', function(done) {
it('should be defined', (done) => {
expect(this.events.stopResponding).toBeDefined();

@@ -126,4 +126,4 @@ done();

it('should remove a registered response', function(done) {
this.events.response('test', function() {});
it('should remove a registered response', (done) => {
this.events.response('test', () => {});
expect(this.events.__responses.test).toBeDefined();

@@ -137,5 +137,5 @@

describe('.command()', function() {
describe('.command()', () => {
it('should be defined', function(done) {
it('should be defined', (done) => {
expect(this.events.command).toBeDefined();

@@ -145,4 +145,4 @@ done();

it('should register a command', function(done) {
var cb = function() {};
it('should register a command', (done) => {
var cb = () => {};
this.events.command('test', cb);

@@ -155,5 +155,5 @@ expect(this.events.__commands.test).toBeDefined();

describe('.execute()', function() {
describe('.execute()', () => {
it('should be defined', function(done) {
it('should be defined', (done) => {
expect(this.events.execute).toBeDefined();

@@ -163,3 +163,3 @@ done();

it('should call a registered command', function(done) {
it('should call a registered command', (done) => {
var spy = jasmine.createSpy('command');

@@ -173,5 +173,5 @@ this.events.command('test', spy);

describe('.stopExecuting()', function() {
describe('.stopExecuting()', () => {
it('should be defined', function(done) {
it('should be defined', (done) => {
expect(this.events.stopExecuting).toBeDefined();

@@ -181,4 +181,4 @@ done();

it('should remove a registered response', function(done) {
this.events.command('test', function() {});
it('should remove a registered response', (done) => {
this.events.command('test', () => {});
expect(this.events.__commands.test).toBeDefined();

@@ -185,0 +185,0 @@

Sorry, the diff of this file is not supported yet

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