mocha/mocha-tests.patch

50 lines
1.8 KiB
Diff
Raw Permalink Normal View History

2020-08-19 15:23:36 +08:00
commit 9e9fc45c6a9c1a943edbdf0b97cedbc55527cb2b
Author: Tom Hughes <tom@compton.nu>
Date: Wed Dec 21 20:29:01 2016 +0000
Patch tests for changes in Node 6.x
Anonymous functions can now get a name from the variable they
are assigned to, which then shows up in the hook title.
diff --git a/test/suite.js b/test/suite.js
index 011b3fb..899d346 100644
--- a/test/suite.js
+++ b/test/suite.js
@@ -136,7 +136,7 @@ describe('Suite', function(){
this.suite._beforeAll.should.have.length(1);
var beforeAllItem = this.suite._beforeAll[0];
- beforeAllItem.title.should.equal('"before all" hook');
+ beforeAllItem.title.should.equal('"before all" hook: fn');
beforeAllItem.fn.should.equal(fn);
});
@@ -171,7 +171,7 @@ describe('Suite', function(){
this.suite._afterAll.should.have.length(1);
var afterAllItem = this.suite._afterAll[0];
- afterAllItem.title.should.equal('"after all" hook');
+ afterAllItem.title.should.equal('"after all" hook: fn');
afterAllItem.fn.should.equal(fn);
});
it('appends title to hook', function(){
@@ -205,7 +205,7 @@ describe('Suite', function(){
this.suite._beforeEach.should.have.length(1);
var beforeEachItem = this.suite._beforeEach[0];
- beforeEachItem.title.should.equal('"before each" hook');
+ beforeEachItem.title.should.equal('"before each" hook: fn');
beforeEachItem.fn.should.equal(fn);
});
@@ -240,7 +240,7 @@ describe('Suite', function(){
this.suite._afterEach.should.have.length(1);
var afterEachItem = this.suite._afterEach[0];
- afterEachItem.title.should.equal('"after each" hook');
+ afterEachItem.title.should.equal('"after each" hook: fn');
afterEachItem.fn.should.equal(fn);
});