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

Fix tsconfig-paths loading issue #181

Merged
merged 2 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"devDependencies": {
"@getgauge/cli": "latest",
"@types/node": "latest",
"taiko": "^1.4.0"
"taiko": "^1.4.0",
"tsconfig-paths": "^4.2.0"
}
}
17 changes: 17 additions & 0 deletions e2e/src/VowelCounter.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export default class VowelCounter {
private vowels: string[];

constructor(vowels: string[]) {
this.vowels = vowels;
}

countVowels(word: string): number {
let count = 0;
for (const char of word) {
if (this.vowels.includes(char.toLowerCase())) {
count++;
}
}
return count;
}
}
14 changes: 9 additions & 5 deletions e2e/tests/implementation.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
import * as assert from "node:assert";
import VowelCounter from "@lib/VowelCounter";
import { DataStoreFactory, Step, type Table } from "gauge-ts";

class Implementation {
static vowelsCount = (word: string): number => {
const vowels = DataStoreFactory.getSpecDataStore().get(
"vowels",
) as string[];
return word.split("").filter((c) => vowels.includes(c)).length;
const counter = DataStoreFactory.getSpecDataStore().get(
"counter",
) as VowelCounter;
return counter.countVowels(word);
};

@Step("Vowels in English language are <aeiou>.")
public async listVowels(vowels: string) {
DataStoreFactory.getSpecDataStore().put("vowels", vowels.split(""));
DataStoreFactory.getSpecDataStore().put(
"counter",
new VowelCounter(vowels.split("")),
);
}

@Step("The word <gauge> has <3> vowels.")
Expand Down
5 changes: 4 additions & 1 deletion e2e/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
"strict": true,
"moduleResolution": "node",
"experimentalDecorators": true,
"emitDecoratorMetadata": true
"emitDecoratorMetadata": true,
"paths": {
"@lib/*": ["./src/*"]
}
},
"include": ["tests/**/*", "gen/**/*"],
"exclude": ["node_modules/"]
Expand Down
3 changes: 3 additions & 0 deletions gauge-ts/launcher.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env node

import { createRequire } from "node:module";
const require = createRequire(import.meta.url);

const version = process.versions.node.split(".");
if (Number.parseInt(version[0]) < 20) {
throw new Error(
Expand Down
2 changes: 1 addition & 1 deletion gauge-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gauge-ts",
"version": "0.3.1",
"version": "0.3.2",
"description": "Typescript runner for Gauge",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion gauge-ts/ts.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"linux": ["./launcher.mjs", "--start"],
"windows": ["launcher.bat", "--start"]
},
"version": "0.3.1",
"version": "0.3.2",
"gRPCSupport": true
}
30 changes: 27 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading