Skip to content
This repository has been archived by the owner on Mar 23, 2021. It is now read-only.

Remove ts-ignores introduced by #2330 #2352

Closed
luckysori opened this issue Mar 30, 2020 · 5 comments · Fixed by #2903
Closed

Remove ts-ignores introduced by #2330 #2352

luckysori opened this issue Mar 30, 2020 · 5 comments · Fixed by #2903
Labels

Comments

@luckysori
Copy link
Contributor

luckysori commented Mar 30, 2020

Problem

Every API test produces a log file which needs to be named after the test. Unfortunately, with Jest this is not straightforward. In the past we used a tiny, hacky JS library to deal with this problem. After PR #2330, we instead instruct Jasmine, the testing framework Jest builds on top of, to give us the name.

That was an improvement, but we had to introduce ts-ignores to silence the compiler here

jasmine.getEnv().addReporter({
specStarted: (result) =>
// @ts-ignore
(jasmine.currentTestName = result.description),
});

and here

function nActorTest(
actorNames: ["alice", "bob", "charlie"] | ["alice", "bob"] | ["alice"],
testFn: (actors: Actors) => Promise<void>
): ProvidesCallback {
return async (done) => {
// @ts-ignore
const name = jasmine.currentTestName;
if (!name.match(/[A-z0-9\-]+/)) {
// We use the test name as a file name for the log and hence need to restrict it.
throw new Error(
`Testname '${name}' is invalid. Only A-z, 0-9 and dashes are allowed.`
);
}
const actors = await createActors(name, actorNames);

Goal

To listen to the compiler. Remove the ts-ignores and deal with the problem.

@luckysori luckysori added the to-refine Clarifications are needed label Mar 30, 2020
@luckysori luckysori self-assigned this Mar 30, 2020
@luckysori luckysori changed the title Remo ts-ignores introduced by #2330 Remove ts-ignores introduced by #2330 Mar 30, 2020
@luckysori luckysori removed the to-refine Clarifications are needed label Apr 28, 2020
@luckysori luckysori removed their assignment Apr 28, 2020
@luckysori
Copy link
Contributor Author

@thomaseizinger I finally refined this one. You may want to add it to an epic 😄

@thomaseizinger thomaseizinger added the good first issue Good for newcomers label Apr 28, 2020
@thomaseizinger
Copy link
Contributor

Thanks @luckysori, I applied good-first-issue to this.
Anyone with TS knowledge should be able to deal with that, it is not a huge priority to us though :)

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@thomaseizinger
Copy link
Contributor

Removing no-activity to keep this around for people who want to pick low hanging fruit :)

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

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

Successfully merging a pull request may close this issue.

2 participants