Skip to content

Commit

Permalink
📸 - Update snapshots.
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandpeelen committed May 9, 2024
1 parent 7149c5e commit db9001b
Show file tree
Hide file tree
Showing 11 changed files with 70 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,29 +34,29 @@ fi
node ./packages/main/src/Main.mjs > ./packages/main/src/output.txt

mv ./packages/main/src/Main.res ./packages/main/src/Main2.res
rewatch build --no-timing=true &> ../snapshots/rename-file.txt
rewatch build --no-timing=true &> ../snapshots/rename-file-"$1".txt
mv ./packages/main/src/Main2.res ./packages/main/src/Main.res
rewatch build &> /dev/null
mv ./packages/main/src/ModuleWithInterface.resi ./packages/main/src/ModuleWithInterface2.resi
rewatch build --no-timing=true &> ../snapshots/rename-interface-file.txt
rewatch build --no-timing=true &> ../snapshots/rename-interface-file-"$1".txt
mv ./packages/main/src/ModuleWithInterface2.resi ./packages/main/src/ModuleWithInterface.resi
rewatch build &> /dev/null
mv ./packages/main/src/ModuleWithInterface.res ./packages/main/src/ModuleWithInterface2.res
rewatch build --no-timing=true &> ../snapshots/rename-file-with-interface.txt
rewatch build --no-timing=true &> ../snapshots/rename-file-with-interface-"$1".txt
mv ./packages/main/src/ModuleWithInterface2.res ./packages/main/src/ModuleWithInterface.res
rewatch build &> /dev/null

# when deleting a file that other files depend on, the compile should fail
rm packages/dep02/src/Dep02.res
rewatch build --no-timing=true &> ../snapshots/remove-file.txt
rewatch build --no-timing=true &> ../snapshots/remove-file-"$1".txt
# replace the absolute path so the snapshot is the same on all machines
replace "s/$(pwd | sed "s/\//\\\\\//g")//g" ../snapshots/remove-file.txt
replace "s/$(pwd | sed "s/\//\\\\\//g")//g" ../snapshots/remove-file-"$1".txt
git checkout -- packages/dep02/src/Dep02.res
rewatch build &> /dev/null

# it should show an error when we have a dependency cycle
echo 'Dep01.log()' >> packages/new-namespace/src/NS_alias.res
rewatch build --no-timing=true &> ../snapshots/dependency-cycle.txt
rewatch build --no-timing=true &> ../snapshots/dependency-cycle-"$1".txt
git checkout -- packages/new-namespace/src/NS_alias.res
rewatch build &> /dev/null

Expand Down
File renamed without changes.
11 changes: 11 additions & 0 deletions tests/snapshots/dependency-cycle-testrepo_yarn.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[1/7]📦 Building package tree...[1/7] 📦 Built package tree in 0.00s
[2/7] 🕵️ Finding source files...[2/7] 🕵️ Found source files in 0.00s
[3/7] 📝 Reading compile state...[3/7] 📝 Read compile state 0.00s
[4/7] 🧹 Cleaning up previous build...[4/7] 🧹 Cleaned 0/10 0.00s
[5/7] 🧱 Parsed 1 source files in 0.00s
[6/7] ️🌴 Collected deps in 0.00s
[7/7] ️🛑 Compiled 0 modules in 0.00s

Can't continue... Found a circular dependency in your code:
NewNamespace.NS_alias -> Dep01 -> Dep02 -> NS -> NewNamespace.NS_alias
Error Building:  ️🛑 Error Running Incremental Build:  ️🛑 Failed to Compile. See Errors Above
Expand Down
File renamed without changes.
24 changes: 24 additions & 0 deletions tests/snapshots/remove-file-testrepo_yarn.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[1/7]📦 Building package tree...[1/7] 📦 Built package tree in 0.00s
[2/7] 🕵️ Finding source files...[2/7] 🕵️ Found source files in 0.00s
[3/7] 📝 Reading compile state...[3/7] 📝 Read compile state 0.00s
[4/7] 🧹 Cleaning up previous build...[4/7] 🧹 Cleaned 1/10 0.00s
[5/7] 🧱 Parsed 0 source files in 0.00s
[6/7] ️🌴 Collected deps in 0.00s
[7/7] ️🛑 Compiled 1 modules in 0.00s

We've found a bug for you!
/packages/dep01/src/Dep01.res:3:9-17

1 │ let log = () => {
2 │ Js.log("02")
3 │ Dep02.log()
4 │ }
5 │

The module or file Dep02 can't be found.
- If it's a third-party dependency:
- Did you add it to the "bs-dependencies" or "bs-dev-dependencies" in bsconfig.json?
- Did you include the file's directory to the "sources" in bsconfig.json?


Error Building:  ️🛑 Error Running Incremental Build:  ️🛑 Failed to Compile. See Errors Above
Expand Down
File renamed without changes.
9 changes: 9 additions & 0 deletions tests/snapshots/rename-file-testrepo_yarn.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[1/7]📦 Building package tree...[1/7] 📦 Built package tree in 0.00s
[2/7] 🕵️ Finding source files...[2/7] 🕵️ Found source files in 0.00s
[3/7] 📝 Reading compile state...[3/7] 📝 Read compile state 0.00s
[4/7] 🧹 Cleaning up previous build...[4/7] 🧹 Cleaned 1/10 0.00s
[5/7] 🧱 Parsed 1 source files in 0.00s
[6/7] ️🌴 Collected deps in 0.00s
[7/7] 🤺 ️Compiled 1 modules in 0.00s

✨ Finished Compilation in 0.00s
Expand Down
10 changes: 10 additions & 0 deletions tests/snapshots/rename-file-with-interface-testrepo_yarn.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[1/7]📦 Building package tree...[1/7] 📦 Built package tree in 0.00s
[2/7] 🕵️ Finding source files...Warning: No implementation file found for interface file (skipping): src/ModuleWithInterface.resi
[2/7] 🕵️ Found source files in 0.00s
[3/7] 📝 Reading compile state...[3/7] 📝 Read compile state 0.00s
[4/7] 🧹 Cleaning up previous build...[4/7] 🧹 Cleaned 2/10 0.00s
[5/7] 🧱 Parsed 1 source files in 0.00s
[6/7] ️🌴 Collected deps in 0.00s
[7/7] 🤺 ️Compiled 1 modules in 0.00s

✨ Finished Compilation in 0.00s
Expand Down
File renamed without changes.
10 changes: 10 additions & 0 deletions tests/snapshots/rename-interface-file-testrepo_yarn.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[1/7]📦 Building package tree...[1/7] 📦 Built package tree in 0.00s
[2/7] 🕵️ Finding source files...Warning: No implementation file found for interface file (skipping): src/ModuleWithInterface2.resi
[2/7] 🕵️ Found source files in 0.00s
[3/7] 📝 Reading compile state...[3/7] 📝 Read compile state 0.00s
[4/7] 🧹 Cleaning up previous build...[4/7] 🧹 Cleaned 1/10 0.00s
[5/7] 🧱 Parsed 1 source files in 0.00s
[6/7] ️🌴 Collected deps in 0.00s
[7/7] 🤺 ️Compiled 1 modules in 0.00s

✨ Finished Compilation in 0.00s
Expand Down

0 comments on commit db9001b

Please sign in to comment.