From 4f1473da3d96f3f8ce6d59b5d0a1898190273bda Mon Sep 17 00:00:00 2001 From: Deven Bansod Date: Fri, 13 Apr 2018 19:14:30 +0530 Subject: [PATCH] Remove global chai.assert in fixture runner's test context --- .../src/index.js | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/packages/babel-helper-transform-fixture-test-runner/src/index.js b/packages/babel-helper-transform-fixture-test-runner/src/index.js index bf1f93f137..fde5f91326 100644 --- a/packages/babel-helper-transform-fixture-test-runner/src/index.js +++ b/packages/babel-helper-transform-fixture-test-runner/src/index.js @@ -28,17 +28,6 @@ const testContext = vm.createContext({ }); testContext.global = testContext; -// Add chai's assert to the global context -// It has to be required inside the testContext as otherwise some assertions do not -// work as chai would reference globals (RegExp, Array, ...) from this context -vm.runInContext( - "(function(require) { global.assert=require('chai').assert; });", - testContext, - { - displayErrors: true, - }, -)(id => runModuleInTestContext(id, __filename)); - // Initialize the test context with the polyfill, and then freeze the global to prevent implicit // global creation in tests, which could cause things to bleed between tests. runModuleInTestContext("@babel/polyfill", __filename);