Skip to content

Commit 7c16b91

Browse files
committed
Make logging test pass with --production
1 parent a2f724f commit 7c16b91

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

packages/logging/logging_test.js

+12-3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,21 @@ Tinytest.add("logging - _getCallerDetails", function (test) {
44
// in Chrome and Firefox, other browsers don't give us an ability to get
55
// stacktrace.
66
if ((new Error).stack) {
7-
test.equal(details.file, Meteor.isServer ?
8-
'tinytest.js' : 'local-test_logging.js');
7+
if (Meteor.isServer) {
8+
test.equal(details.file, 'tinytest.js');
9+
} else {
10+
// Note that we want this to work in --production too, so we need to allow
11+
// for the minified filename.
12+
test.matches(details.file,
13+
/^(?:local-test_logging\.js|[a-f0-9]{40}\.js)$/);
14+
}
915

1016
// evaled statements shouldn't crash
1117
var code = "Log._getCallerDetails().file";
12-
test.matches(eval(code), /^eval|local-test_logging.js$/);
18+
// Note that we want this to work in --production too, so we need to allow
19+
// for the minified filename
20+
test.matches(eval(code),
21+
/^(?:eval|local-test_logging\.js|[a-f0-9]{40}\.js)/);
1322
}
1423
});
1524

0 commit comments

Comments
 (0)