Skip to content

Commit

Permalink
refactor(): define functions consistently
Browse files Browse the repository at this point in the history
  • Loading branch information
JamieMason committed Jan 30, 2017
1 parent 11c4eac commit 496ce29
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions examples/jasmine-cli/src/sum.spec.js
Original file line number Diff line number Diff line change
@@ -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);
});
});
10 changes: 5 additions & 5 deletions examples/jest/src/sum.spec.js
Original file line number Diff line number Diff line change
@@ -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);
});
});
4 changes: 2 additions & 2 deletions test/toHaveUndefined.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 496ce29

Please sign in to comment.