This repository was archived by the owner on Apr 3, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +5
-6
lines changed
Expand file tree Collapse file tree 3 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 1313 * See the License for the specific language governing permissions and
1414 * limitations under the License.
1515 */
16- 'use strict' ;
1716
1817const realAssert = require ( 'assert' ) ;
1918
2019const nop = _ => _ ;
21- const fakeAssert = nop ;
20+ const fakeAssert : any = nop ;
2221fakeAssert . deepEqual = fakeAssert . deepStrictEqual = fakeAssert . doesNotThrow =
2322 fakeAssert . equal = fakeAssert . fail = fakeAssert . ifError =
2423 fakeAssert . notDeepEqual = fakeAssert . notDeepStrictEqual =
2524 fakeAssert . notEqual = fakeAssert . notStrictEqual = fakeAssert . ok =
26- fakeAssert . strictEqual = fakeAssert . throws =
25+ fakeAssert . strictEqual = fakeAssert . throws =
2726 fakeAssert . AssertionError = nop ;
2827
29- module . exports = function debugAssert ( enableAssertions ) {
28+ export function debugAssert ( enableAssertions ) {
3029 return enableAssertions ? realAssert : fakeAssert ;
3130} ;
Original file line number Diff line number Diff line change 1414 * limitations under the License.
1515 */
1616var ScopeType = require ( 'vm' ) . runInDebugContext ( 'ScopeType' ) ;
17- var assert = require ( './debug-assert' ) ( process . env . CLOUD_DEBUG_ASSERTIONS ) ;
17+ var assert = require ( './debug-assert' ) . debugAssert ( process . env . CLOUD_DEBUG_ASSERTIONS ) ;
1818var util = require ( 'util' ) ;
1919var lodash = require ( 'lodash' ) ;
2020var transform = lodash . transform ;
Original file line number Diff line number Diff line change 1818const realAssert = require ( 'assert' ) ;
1919
2020describe ( 'debug-assert' , ( ) => {
21- const debugAssert = require ( '../src/agent/debug-assert.js' ) ;
21+ const debugAssert = require ( '../src/agent/debug-assert.js' ) . debugAssert ;
2222
2323 it ( 'should fire assertions when enabled' , ( ) => {
2424 realAssert . throws ( ( ) => {
You can’t perform that action at this time.
0 commit comments