Skip to content

Commit

Permalink
test: modified tests not working property
Browse files Browse the repository at this point in the history
  • Loading branch information
kyungw00k committed Jun 8, 2018
1 parent 347b479 commit 6067410
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 12 deletions.
3 changes: 0 additions & 3 deletions test/webrequest-on-before-redirect.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,7 @@ describe('onBeforeRedirect', function () {
})

afterEach(function * () {
nightmare.child.removeAllListeners('onBeforeRequest')
nightmare.onBeforeRequest(null)

nightmare.child.removeAllListeners('onBeforeRedirect')
nightmare.onBeforeRedirect(null)

yield nightmare.end()
Expand Down
7 changes: 3 additions & 4 deletions test/webrequest-on-before-request.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ describe('onBeforeRequest', function () {
result.url.should.equal(result.url, 'http://localhost:7500/')
result.method.should.equal(result.method, 'POST')
result.resourceType.should.equal(result.resourceType, 'xhr')
qs.parse(new Buffer(result.uploadData[0].bytes.data).toString()).should.deep.equals({
name: 'post test',

JSON.stringify(qs.parse(new Buffer(result.uploadData[0].bytes.data).toString())).should.equals(JSON.stringify({ name: 'post test',
type: 'string'
})
}))
})

it('can redirect the request', function * () {
Expand Down Expand Up @@ -216,7 +216,6 @@ describe('onBeforeRequest', function () {
})

afterEach(function * () {
nightmare.child.removeAllListeners('onBeforeRequest')
nightmare.onBeforeRequest(null)

yield nightmare.end()
Expand Down
3 changes: 0 additions & 3 deletions test/webrequest-on-before-send-headers.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,7 @@ describe('onBeforeSendHeaders', function () {
})

afterEach(function * () {
nightmare.child.removeAllListeners('onBeforeSendHeaders')
nightmare.onBeforeSendHeaders(null)

nightmare.child.removeAllListeners('onSendHeaders')
nightmare.onSendHeaders(null)

yield nightmare.end()
Expand Down
1 change: 0 additions & 1 deletion test/webrequest-on-completed.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ describe('onCompleted', function () {
})

afterEach(function * () {
nightmare.child.removeAllListeners('onCompleted')
nightmare.onCompleted(null)

yield nightmare.end()
Expand Down
1 change: 0 additions & 1 deletion test/webrequest-on-send-headers.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ describe('onSendHeaders', function () {
})

afterEach(function * () {
nightmare.child.removeAllListeners('onSendHeaders')
nightmare.onSendHeaders(null)
yield nightmare.end()
})
Expand Down

0 comments on commit 6067410

Please sign in to comment.