diff --git a/src/lib/frameworks/jest.js b/src/lib/frameworks/jest.js index 91363ec7..1b9c07d1 100644 --- a/src/lib/frameworks/jest.js +++ b/src/lib/frameworks/jest.js @@ -7,6 +7,7 @@ const { getLineNumber, getEndLineNumber, getCode, + jest, } = require('../utils'); module.exports = (ast, file = '', source = '', opts = {}) => { @@ -128,6 +129,7 @@ module.exports = (ast, file = '', source = '', opts = {}) => { } if (path.isIdentifier({ name: 'test' }) || path.isIdentifier({ name: 'it' })) { + if (jest.isConcurrentTest(path.parent)) path = path.parentPath; if (!hasStringOrTemplateArgument(path.parent)) return; let code = ''; diff --git a/src/lib/utils.js b/src/lib/utils.js index d8814ab5..f96be536 100644 --- a/src/lib/utils.js +++ b/src/lib/utils.js @@ -212,12 +212,19 @@ const arrayCompare = function (a, b, id) { }; }; +const jest = { + isConcurrentTest: path => { + return path.property?.name === 'concurrent'; + }, +}; + module.exports = { hasStringArgument, hasTemplateQuasi, getLineNumber, getEndLineNumber, getCode, + jest, hasTemplateArgument, getQuasiArgument, parseComments,