Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with template literal index #349

Open
UnleashSpirit opened this issue Dec 22, 2023 · 1 comment
Open

Error with template literal index #349

UnleashSpirit opened this issue Dec 22, 2023 · 1 comment
Labels

Comments

@UnleashSpirit
Copy link

Hello,

I love this plugin that offer a simple way to "Run | Debug" a test generating directly correct command line :)
I often used it.each and template literal like this

it.each`
  a    | b
  ${1} | ${2}
  ${1} | ${2}
`('Test $a $b', ({ a, b }) => {
  [...]
});

the problem is when I want to used index, $#, the generated command line not working.

It generates

[...] -t "EcheancesDelais_BoutonPaiementComponent \$# Test (.*?) (.*?)"

The \$# not matches anything and tests are skipped

The workaround for now is to modify the command line with (.+?) (very simple way)

[...] -t "EcheancesDelais_BoutonPaiementComponent (.+?) Test (.*?) (.*?)"

    √ 0 Test 1 2 (132 ms)
    √ 1 Test 1 2 (9 ms)

It would be great if the plugin can manage this template literal index $# (which is %# in array each execution)

@firsttris firsttris added the bug label Feb 20, 2024
@firsttris
Copy link
Owner

i think its just missing the escaping for this character.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants