forked from elm-explorations/test
-
Notifications
You must be signed in to change notification settings - Fork 0
Add equalToFile to Expect
#1
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
ac0a8d1
Add `equalToFile` to Expect
micahhahn f90579b
Harden our file access API
micahhahn 1ec5b4d
Add pretty printer to query
micahhahn a84a18b
No need to check `existsSync`, `mkdirSync` works just fine if the dir…
micahhahn c9e645c
Add "node:" prefix to imports
micahhahn d7bac45
Write to a temp file if there are diffs and output instructions for h…
micahhahn d8fa6ea
Add OVERWRITE_GOLDEN_FILES behavior
micahhahn dd21c67
Write a ".failed" file next to the golden file instead of in temp
micahhahn 5f2caf6
Bring the file deletion into Elm land
micahhahn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| module File exposing (readFile, writeFile, FileError(..)) | ||
|
|
||
| import Elm.Kernel.Test | ||
|
|
||
| type FileError | ||
| = FileNotFound | ||
| | IsDirectory | ||
| | PathEscapesDirectory | ||
| | GeneralFileError String | ||
|
|
||
| readFile : String -> Result FileError String | ||
| readFile = Elm.Kernel.Test.readFile | ||
|
|
||
| writeFile : String -> String -> Result FileError () | ||
| writeFile = Elm.Kernel.Test.writeFile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is probably worth adding the
node:prefix to these Node built-ins.Node supports this, and Deno and Bun both have Node-compatible APIs that require it.
It might be worth testing with
elm-test-rs --deno(https://github.com/mpizenberg/elm-test-rs?tab=readme-ov-file#deno-runtime)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brian-carroll OK so I finally got around to looking into this and I was having trouble getting
elm-test-rs --denoto run... have you ever done this successfully?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hadn't tried it when I made the comment.
I tried it just now and got the same message... and realised it meant I didn't have Deno installed! 😆
What do you get for
which deno?I installed it, tried again, and got an error that suggests
elm-test-rshas not been updated to support more recent versions of Deno. Deno support seems to have been added 4 years ago. The current Deno version is 2.5.4. The latest v1 release is 1.46.3.elm-test-rsseems to have errors with both.I still think importing from
node:fsinstead of justfsis the correct fix. It constitutes full support for both Deno and Bun as far as this repo is concerned, based on their own docs:Deno's docs on Node compatibility
Bun's docs on Node compatibility
Beyond that, if users are still having issues, the problem is in another repo such as
elm-test-rs.Details