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

Compiled TypeScript glue code/steps in in node_modules are not being recognized by autocomplete #253

Open
zamioku opened this issue Oct 31, 2024 · 0 comments

Comments

@zamioku
Copy link

zamioku commented Oct 31, 2024

👓 What did you see?

At my company we have a set of common steps which we keep in a common npm library which we all import into our individual projects. I have some step definitions that I am importing from a compiled TypeScript source.

Here is a snippet of how the compiled .js file looks like:

`
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator"throw"); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.cucumberSteps = void 0;
///
const cucumber_1 = require("@cucumber/cucumber");
const apiClient_1 = require("../../apiClient");
const apiStepsFunctionHelpers_1 = require("./helpers");
let apiClient = (0, apiClient_1.getApiClient)();

(0, cucumber_1.Given)('I set the endpoint to {string}', function (endpoint) {
(0, apiStepsFunctionHelpers_1.setEndpoint)(this, endpoint);
});
(0, cucumber_1.When)('I set the header(s) to:', function (headersTable) {
const headers = headersTable.rowsHash();
(0, apiClient_1.setHeaders)(apiClient, headers);
});
(0, cucumber_1.Then)(/^the response status should be (\d{3})$/, function (status) {
(0, apiStepsFunctionHelpers_1.assertResponseStatus)(this, status);
});

exports.cucumberSteps = {
Given: cucumber_1.Given,
When: cucumber_1.When,
Then: cucumber_1.Then,
};
`

While running cucumber-js with the glue code path correctly set into my cucumber.js config file, the steps are executed and they work. However, the autocomplete does not pick up any of these steps.

✅ What did you expect to see?

I expect the autocomplete feature of this plugin to identify these compiled step definitions, just like the other plugin does.

📦 Which tool/library version are you using?

node v20
cucumber-js v11.0.1
cucumber/vscode v1.10.0

🔬 How could we reproduce it?

No response

📚 Any additional context?

NOTES:

  • The other cucumber plugin "Cucumber (Gherkin) Full Support" does recognize these steps and provides autocomplete, but I don't want to use that one, I want to use the official plugin (because this one is just better)
  • the path in my VS Code settings.json is 100% correct, as it is the same one I use in my cucumber.js and in the other plugin that works.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant