Просмотр исходного кода

Merge pull request #7 from overleaf/fix-expect

Fix incorrect expect
John Lees-Miller 6 лет назад
Родитель
Сommit
2a5b6ccd98
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      libraries/o-error/test/support/index.js

+ 1 - 1
libraries/o-error/test/support/index.js

@@ -24,7 +24,7 @@ exports.expectError = function OErrorExpectError (e, expected) {
   expect(e.toString()).to.equal(expected.message)
   expect(e.toString()).to.equal(expected.message)
 
 
   // stack should start with the default error message formatting
   // stack should start with the default error message formatting
-  expect(e.stack.split('\n')[0], expected.name)
+  expect(e.stack.split('\n')[0]).to.match(new RegExp(`^${expected.name}:`))
 
 
   // first stack frame should be the function where the error was thrown
   // first stack frame should be the function where the error was thrown
   expect(e.stack.split('\n')[1]).to.match(expected.firstFrameRx)
   expect(e.stack.split('\n')[1]).to.match(expected.firstFrameRx)