diff --git a/packages/jest-jasmine2/src/jasmine/Env.js b/packages/jest-jasmine2/src/jasmine/Env.js index c0cc29f7f7cc..179529922ada 100644 --- a/packages/jest-jasmine2/src/jasmine/Env.js +++ b/packages/jest-jasmine2/src/jasmine/Env.js @@ -52,7 +52,6 @@ export default function(j$) { const realClearTimeout = global.clearTimeout; const runnableResources = {}; - let currentSpec = null; const currentlyExecutingSuites = []; let currentDeclarationSuite = null; @@ -173,6 +172,9 @@ export default function(j$) { const topSuite = new j$.Suite({ id: getNextSuiteId(), + getTestPath() { + return j$.testPath; + }, }); defaultResourcesForRunnable(topSuite.id); currentDeclarationSuite = topSuite; @@ -291,6 +293,9 @@ export default function(j$) { description, parentSuite: currentDeclarationSuite, throwOnExpectationFailure, + getTestPath() { + return j$.testPath; + }, }); return suite; diff --git a/packages/jest-jasmine2/src/jasmine/Suite.js b/packages/jest-jasmine2/src/jasmine/Suite.js index 9fcd6ba9f353..bf5910ed6550 100644 --- a/packages/jest-jasmine2/src/jasmine/Suite.js +++ b/packages/jest-jasmine2/src/jasmine/Suite.js @@ -54,6 +54,7 @@ export default function Suite(attrs: Object) { description: this.description, fullName: this.getFullName(), failedExpectations: [], + testPath: attrs.getTestPath(), }; }