From 8cb47862a24584757e6047ca93de90b56e4d3fe0 Mon Sep 17 00:00:00 2001 From: Daniel K Date: Mon, 3 Oct 2016 20:42:38 +0200 Subject: [PATCH] Fix warn-on-top-level-this test --- test/function/warn-on-top-level-this/_config.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/function/warn-on-top-level-this/_config.js b/test/function/warn-on-top-level-this/_config.js index c667044..fd8f9a0 100644 --- a/test/function/warn-on-top-level-this/_config.js +++ b/test/function/warn-on-top-level-this/_config.js @@ -3,9 +3,10 @@ const assert = require( 'assert' ); module.exports = { description: 'warns on top-level this (#770)', warnings: warnings => { - assert.deepEqual( warnings, [ - 'The `this` keyword is equivalent to `undefined` at the top level of an ES module, and has been rewritten' - ]); + const message = `The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten`; + assert.equal(warnings.length, 1); + assert.equal(warnings[0].indexOf(message), 0); + assert(warnings[0].match(/\(in.*warn-on-top-level-this.*\)/)); }, runtimeError: err => { assert.equal( err.message, `Cannot set property 'foo' of undefined` );