From 496ce298a7e2b94868f476021c917d1e90413dc3 Mon Sep 17 00:00:00 2001 From: Jamie Mason Date: Mon, 30 Jan 2017 19:44:11 +0000 Subject: [PATCH] refactor(): define functions consistently --- examples/jasmine-cli/src/sum.spec.js | 10 +++++----- examples/jest/src/sum.spec.js | 10 +++++----- test/toHaveUndefined.spec.js | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/examples/jasmine-cli/src/sum.spec.js b/examples/jasmine-cli/src/sum.spec.js index 4ba9c74..034be26 100644 --- a/examples/jasmine-cli/src/sum.spec.js +++ b/examples/jasmine-cli/src/sum.spec.js @@ -1,14 +1,14 @@ -describe('sum(a, b)', () => { - beforeEach(() => { +describe('sum(a, b)', function () { + beforeEach(function () { this.sum = require('./sum'); }); - it('is a function', () => { + it('is a function', function () { expect(this.sum).toBeFunction(); }); - it('returns a number', () => { + it('returns a number', function () { expect(this.sum(1, 2)).toBeNumber(); }); - it('add numbers correctly', () => { + it('add numbers correctly', function () { expect(this.sum(1, 2)).toEqual(3); }); }); diff --git a/examples/jest/src/sum.spec.js b/examples/jest/src/sum.spec.js index 4ba9c74..034be26 100644 --- a/examples/jest/src/sum.spec.js +++ b/examples/jest/src/sum.spec.js @@ -1,14 +1,14 @@ -describe('sum(a, b)', () => { - beforeEach(() => { +describe('sum(a, b)', function () { + beforeEach(function () { this.sum = require('./sum'); }); - it('is a function', () => { + it('is a function', function () { expect(this.sum).toBeFunction(); }); - it('returns a number', () => { + it('returns a number', function () { expect(this.sum(1, 2)).toBeNumber(); }); - it('add numbers correctly', () => { + it('add numbers correctly', function () { expect(this.sum(1, 2)).toEqual(3); }); }); diff --git a/test/toHaveUndefined.spec.js b/test/toHaveUndefined.spec.js index 5303ea8..ab4aa14 100644 --- a/test/toHaveUndefined.spec.js +++ b/test/toHaveUndefined.spec.js @@ -4,13 +4,13 @@ var describeToHaveX = require('./lib/describeToHaveX'); // spec describe('toHaveUndefined', function () { describeToHaveX('toHaveUndefined', function () { - describe('when subject does NOT have a member at the given key', () => { + describe('when subject does NOT have a member at the given key', function () { it('should deny', function () { expect({}).not.toHaveUndefined('memberName'); expect(null).not.toHaveUndefined('memberName'); }); }); - describe('when subject DOES have a member at the given key', () => { + describe('when subject DOES have a member at the given key', function () { describe('when subject IS undefined', function () { it('should confirm', function () { expect({