diff --git a/tests/compile.sh b/tests/compile.sh index b42b1ba..bcf26ce 100755 --- a/tests/compile.sh +++ b/tests/compile.sh @@ -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 diff --git a/tests/snapshots/dependency-cycle.txt b/tests/snapshots/dependency-cycle-testrepo_pnpm.txt similarity index 100% rename from tests/snapshots/dependency-cycle.txt rename to tests/snapshots/dependency-cycle-testrepo_pnpm.txt diff --git a/tests/snapshots/dependency-cycle-testrepo_yarn.txt b/tests/snapshots/dependency-cycle-testrepo_yarn.txt new file mode 100644 index 0000000..10c4e55 --- /dev/null +++ b/tests/snapshots/dependency-cycle-testrepo_yarn.txt @@ -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 diff --git a/tests/snapshots/remove-file.txt b/tests/snapshots/remove-file-testrepo_pnpm.txt similarity index 100% rename from tests/snapshots/remove-file.txt rename to tests/snapshots/remove-file-testrepo_pnpm.txt diff --git a/tests/snapshots/remove-file-testrepo_yarn.txt b/tests/snapshots/remove-file-testrepo_yarn.txt new file mode 100644 index 0000000..228ef79 --- /dev/null +++ b/tests/snapshots/remove-file-testrepo_yarn.txt @@ -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 diff --git a/tests/snapshots/rename-file.txt b/tests/snapshots/rename-file-testrepo_pnpm.txt similarity index 100% rename from tests/snapshots/rename-file.txt rename to tests/snapshots/rename-file-testrepo_pnpm.txt diff --git a/tests/snapshots/rename-file-testrepo_yarn.txt b/tests/snapshots/rename-file-testrepo_yarn.txt new file mode 100644 index 0000000..68d3ebf --- /dev/null +++ b/tests/snapshots/rename-file-testrepo_yarn.txt @@ -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 diff --git a/tests/snapshots/rename-file-with-interface.txt b/tests/snapshots/rename-file-with-interface-testrepo_pnpm.txt similarity index 100% rename from tests/snapshots/rename-file-with-interface.txt rename to tests/snapshots/rename-file-with-interface-testrepo_pnpm.txt diff --git a/tests/snapshots/rename-file-with-interface-testrepo_yarn.txt b/tests/snapshots/rename-file-with-interface-testrepo_yarn.txt new file mode 100644 index 0000000..e16ce55 --- /dev/null +++ b/tests/snapshots/rename-file-with-interface-testrepo_yarn.txt @@ -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 diff --git a/tests/snapshots/rename-interface-file.txt b/tests/snapshots/rename-interface-file-testrepo_pnpm.txt similarity index 100% rename from tests/snapshots/rename-interface-file.txt rename to tests/snapshots/rename-interface-file-testrepo_pnpm.txt diff --git a/tests/snapshots/rename-interface-file-testrepo_yarn.txt b/tests/snapshots/rename-interface-file-testrepo_yarn.txt new file mode 100644 index 0000000..d980584 --- /dev/null +++ b/tests/snapshots/rename-interface-file-testrepo_yarn.txt @@ -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