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

Add JavaScript example for jslib/testing/3-integration-suite/ #4250

Closed

Conversation

ayewo
Copy link
Contributor

@ayewo ayewo commented Jan 5, 2025

In continuation of the work started in #3927, this PR when closed, will add:

  • example/jslib/testing/
    • 3-integration-suite/: demonstrating usage of at least 2 Javascript integration testing frameworks cypress and playwright

I've figured out a way to simplify the compilation logic in TypeScriptModule, specifically in:

def compilerOptionsBuilder: Task[Map[String, ujson.Value]] = Task.Anon {
val declarationsOut = Task.dest / "declarations"
val combinedPaths =
upstreamPathsBuilder() ++
generatedSources().map(p => ("@generated/*", p.path.toString)) ++
modulePaths() ++
compilerOptionsPaths().toSeq
val combinedCompilerOptions: Map[String, ujson.Value] = compilerOptions() ++ Map(
"declarationDir" -> ujson.Str(declarationsOut.toString),
"typeRoots" -> ujson.Arr(
(npmInstall().path / "node_modules/@types").toString,
declarationsOut.toString
),
"paths" -> ujson.Obj.from(combinedPaths.map { case (k, v) =>
val splitValues =
v.split(":").map(s => s"$s/*") // Split by ":" and append "/*" to each part
(k, ujson.Arr.from(splitValues))
})
)
combinedCompilerOptions
}

Still testing to make sure it doesn't introduce any side effects.

@lihaoyi
Copy link
Member

lihaoyi commented Jan 6, 2025

@ayewo I see you have these commented out

//  object playwright extends TypeScriptTests with TestModule.Jest
//  object cypress extends TypeScriptTests with TestModule.Vitest

Should they work if uncommented, or is it still WIP?

@ayewo
Copy link
Contributor Author

ayewo commented Jan 6, 2025

@ayewo I see you have these commented out

//  object playwright extends TypeScriptTests with TestModule.Jest
//  object cypress extends TypeScriptTests with TestModule.Vitest

Should they work if uncommented, or is it still WIP?

Still WIP.

@lihaoyi
Copy link
Member

lihaoyi commented Jan 7, 2025

closing in favor of #4253

@lihaoyi lihaoyi closed this Jan 7, 2025
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

Successfully merging this pull request may close these issues.

2 participants