Files
shields/services/icedfrisby-no-nock.js
Marcin Mielnicki c72e366895 Run service tests on a given (remote) instance; test on [jetbrains] (#2195)
* Allow to run service tests for remote shields instance

* Allow to run service tests for remote shields instance - doc

* Load testedServerUrl from env variable

* Load 'skipIntercepted' flag from env variable
2018-11-25 15:51:57 +01:00

32 lines
687 B
JavaScript

'use strict'
// based on https://github.com/paulmelnikow/icedfrisby-nock/blob/master/icedfrisby-nock.js
// can be used to wrap the original "icedfrisby-nock" to check if request was intercepred
const factory = superclass =>
class IcedFrisbyNock extends superclass {
constructor(message) {
super(message)
this.intercepted = false
}
intercept(setup) {
super.intercept(setup)
this.intercepted = true
return this
}
networkOff() {
super.networkOff()
this.intercepted = true
return this
}
networkOn() {
super.networkOn()
this.intercepted = true
return this
}
}
module.exports = factory