Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"url": "git+https://github.com/FE-star/exercise4.git"
},
"keywords": [
"tet"
"test"
],
"author": "Daniel Yang",
"license": "MIT",
Expand Down
1 change: 0 additions & 1 deletion test/mocha.opts
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
--require should
10 changes: 6 additions & 4 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
require('should');

describe('this', function () {
it('setTimeout', function (done) {
var obj = {
say: function () {
setTimeout(() => {
// this 是什么?想想为什么?
this.should.equal(null)
this.should.equal(obj)
done()
}, 0)
}
Expand All @@ -15,7 +17,7 @@ describe('this', function () {
it('global', function () {
function test() {
// this 是什么?想想为什么?
this.should.equal(null)
this.should.equal(global)
}
test()
})
Expand All @@ -26,7 +28,7 @@ describe('this', function () {
say: function () {
function _say() {
// this 是什么?想想为什么?
this.should.equal(null)
this.should.equal(global)
}
return _say.bind(obj)
}()
Expand All @@ -39,7 +41,7 @@ describe('this', function () {
obj.say = function () {
function _say() {
// this 是什么?想想为什么?
this.should.equal(null)
this.should.equal(obj)
}
return _say.bind(obj)
}()
Expand Down