Skip to content
Open
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
40 changes: 40 additions & 0 deletions src/config-imports.3tg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Exported functions from "src/config-imports.ts"

<!--
```json configuration
{
"testing-framework": "vitest",
"no-mock-imports": true
}
```
-->

```json configuration
{
"before-imports": [
"// Here we test only `toFileUrl` from `src/config-imports.ts` as",
"// `pathsForImport` and `readExternalEntries` should be tested for",
"// their corresponding source code files"
]
}
```

## toFileUrl(filePath: string)

These are the functional requirements for function `toFileUrl`.

| test name | filePath | toFileUrl |
| --------- | --------------- | ------------------------------- |
| | '/foo' | 'file:///foo' as any |
| | '/foo#1' | 'file:///foo%231' as any |
| | '/some/path%.c' | 'file:///some/path%25.c' as any |

We need to use `as any` as the return is of type `URL`, but we'll change the argument for `expect()` so we can compare it with our strings.

```json configuration
{
"expect-values": {
"/toFileUrl/": "$$(filePath).href"
}
}
```
Loading