-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7cbedba
commit c7dcf85
Showing
19 changed files
with
237 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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 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 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
47 changes: 47 additions & 0 deletions
47
modules/plugin/src/sbt-test/sbt-snapshot4s/sbt-typelevel/build.sbt
This file contains 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,47 @@ | ||
import snapshot4s.BuildInfo.snapshot4sVersion | ||
|
||
val Scala3 = "3.3.0" | ||
ThisBuild / crossScalaVersions := Seq("2.13.11", Scala3) | ||
ThisBuild / scalaVersion := Scala3 | ||
ThisBuild / tlBaseVersion := "0.4" | ||
lazy val root = tlCrossRootProject.aggregate(core, utils) | ||
|
||
lazy val core = crossProject(JVMPlatform, JSPlatform) | ||
.crossType(CrossType.Pure) | ||
.in(file("core")) | ||
.settings( | ||
name := "core", | ||
snapshot4sResourceDirectory := CrossType.Pure | ||
.sharedResourcesDir(baseDirectory.value, "test") | ||
.get / "snapshot", | ||
testFrameworks += new TestFramework("weaver.framework.CatsEffect"), | ||
Test / scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.CommonJSModule) }, | ||
libraryDependencies += "com.siriusxm" %%% "snapshot4s-weaver" % snapshot4sVersion % Test | ||
) | ||
.enablePlugins(Snapshot4sPlugin) | ||
|
||
lazy val utils = crossProject(JVMPlatform, JSPlatform) | ||
.crossType(CrossType.Full) | ||
.in(file("utils")) | ||
.settings( | ||
name := "utils", | ||
snapshot4sResourceDirectory := CrossType.Full | ||
.sharedResourcesDir(baseDirectory.value, "test") | ||
.get / "snapshot", | ||
Test / scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.CommonJSModule) }, | ||
testFrameworks += new TestFramework("weaver.framework.CatsEffect"), | ||
libraryDependencies += "com.siriusxm" %%% "snapshot4s-weaver" % snapshot4sVersion % Test | ||
) | ||
.enablePlugins(Snapshot4sPlugin) | ||
|
||
lazy val framework = crossProject(JVMPlatform, JSPlatform) | ||
.crossType(CrossType.Full) | ||
.in(file("framework")) | ||
.settings( | ||
name := "framework", | ||
Test / scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.CommonJSModule) }, | ||
testFrameworks += new TestFramework("weaver.framework.CatsEffect"), | ||
libraryDependencies += "com.siriusxm" %%% "snapshot4s-weaver" % snapshot4sVersion % Test | ||
) | ||
.enablePlugins(Snapshot4sPlugin) | ||
|
1 change: 1 addition & 0 deletions
1
.../src/sbt-test/sbt-snapshot4s/sbt-typelevel/core/src/test/resources/snapshot/existing-file
This file contains 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 @@ | ||
old-contents |
1 change: 1 addition & 0 deletions
1
...bt-snapshot4s/sbt-typelevel/core/src/test/resources/snapshot/nested-directory/nested-file
This file contains 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 @@ | ||
old-contents |
29 changes: 29 additions & 0 deletions
29
...les/plugin/src/sbt-test/sbt-snapshot4s/sbt-typelevel/core/src/test/scala/SimpleTest.scala
This file contains 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,29 @@ | ||
package simple | ||
|
||
import weaver._ | ||
import snapshot4s.weaver.SnapshotExpectations | ||
import snapshot4s.generated.snapshotConfig | ||
|
||
object SimpleTest extends SimpleIOSuite with SnapshotExpectations { | ||
|
||
test("inline") { | ||
assertInlineSnapshot(1, 2) | ||
} | ||
|
||
test("new inline snapshot") { | ||
assertInlineSnapshot(1, ???) | ||
} | ||
|
||
test("file that doesn't exist") { | ||
assertFileSnapshot("contents", "nonexistent-file") | ||
} | ||
|
||
test("existing file") { | ||
assertFileSnapshot("contents", "existing-file") | ||
} | ||
|
||
test("file in nested directory") { | ||
assertFileSnapshot("contents", "nested-directory/nested-file") | ||
} | ||
|
||
} |
1 change: 1 addition & 0 deletions
1
...-test/sbt-snapshot4s/sbt-typelevel/framework/js/src/test/resources/snapshot/existing-file
This file contains 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 @@ | ||
old-contents |
1 change: 1 addition & 0 deletions
1
...hot4s/sbt-typelevel/framework/js/src/test/resources/snapshot/nested-directory/nested-file
This file contains 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 @@ | ||
old-contents |
29 changes: 29 additions & 0 deletions
29
...in/src/sbt-test/sbt-snapshot4s/sbt-typelevel/framework/js/src/test/scala/SimpleTest.scala
This file contains 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,29 @@ | ||
package simple | ||
|
||
import weaver._ | ||
import snapshot4s.weaver.SnapshotExpectations | ||
import snapshot4s.generated.snapshotConfig | ||
|
||
object SimpleTest extends SimpleIOSuite with SnapshotExpectations { | ||
|
||
test("inline") { | ||
assertInlineSnapshot(1, 2) | ||
} | ||
|
||
test("new inline snapshot") { | ||
assertInlineSnapshot(1, ???) | ||
} | ||
|
||
test("file that doesn't exist") { | ||
assertFileSnapshot("contents", "nonexistent-file") | ||
} | ||
|
||
test("existing file") { | ||
assertFileSnapshot("contents", "existing-file") | ||
} | ||
|
||
test("file in nested directory") { | ||
assertFileSnapshot("contents", "nested-directory/nested-file") | ||
} | ||
|
||
} |
1 change: 1 addition & 0 deletions
1
...test/sbt-snapshot4s/sbt-typelevel/framework/jvm/src/test/resources/snapshot/existing-file
This file contains 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 @@ | ||
old-contents |
1 change: 1 addition & 0 deletions
1
...ot4s/sbt-typelevel/framework/jvm/src/test/resources/snapshot/nested-directory/nested-file
This file contains 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 @@ | ||
old-contents |
29 changes: 29 additions & 0 deletions
29
...n/src/sbt-test/sbt-snapshot4s/sbt-typelevel/framework/jvm/src/test/scala/SimpleTest.scala
This file contains 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,29 @@ | ||
package simple | ||
|
||
import weaver._ | ||
import snapshot4s.weaver.SnapshotExpectations | ||
import snapshot4s.generated.snapshotConfig | ||
|
||
object SimpleTest extends SimpleIOSuite with SnapshotExpectations { | ||
|
||
test("inline") { | ||
assertInlineSnapshot(1, 2) | ||
} | ||
|
||
test("new inline snapshot") { | ||
assertInlineSnapshot(1, ???) | ||
} | ||
|
||
test("file that doesn't exist") { | ||
assertFileSnapshot("contents", "nonexistent-file") | ||
} | ||
|
||
test("existing file") { | ||
assertFileSnapshot("contents", "existing-file") | ||
} | ||
|
||
test("file in nested directory") { | ||
assertFileSnapshot("contents", "nested-directory/nested-file") | ||
} | ||
|
||
} |
1 change: 1 addition & 0 deletions
1
modules/plugin/src/sbt-test/sbt-snapshot4s/sbt-typelevel/project/build.properties
This file contains 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 @@ | ||
sbt.version=1.10.1 |
10 changes: 10 additions & 0 deletions
10
modules/plugin/src/sbt-test/sbt-snapshot4s/sbt-typelevel/project/plugins.sbt
This file contains 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,10 @@ | ||
addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.7.2") | ||
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.16.0") | ||
|
||
sys.props.get("plugin.version") match { | ||
case Some(x) => | ||
addSbtPlugin("com.siriusxm" % "sbt-snapshot4s" % x) | ||
case _ => | ||
sys.error("""|The system property 'plugin.version' is not defined. | ||
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin) | ||
} |
8 changes: 8 additions & 0 deletions
8
modules/plugin/src/sbt-test/sbt-snapshot4s/sbt-typelevel/test
This file contains 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,8 @@ | ||
# Generated code should link | ||
> Test / compile | ||
# Tests should fail as snapshots are out of date | ||
-> Test / test | ||
# Update snapshots | ||
> snapshot4sPromote | ||
# Tests should succeed with updated snapshots | ||
> Test / test |
1 change: 1 addition & 0 deletions
1
...-test/sbt-snapshot4s/sbt-typelevel/utils/shared/src/test/resources/snapshot/existing-file
This file contains 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 @@ | ||
old-contents |
1 change: 1 addition & 0 deletions
1
...hot4s/sbt-typelevel/utils/shared/src/test/resources/snapshot/nested-directory/nested-file
This file contains 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 @@ | ||
old-contents |
29 changes: 29 additions & 0 deletions
29
...in/src/sbt-test/sbt-snapshot4s/sbt-typelevel/utils/shared/src/test/scala/SimpleTest.scala
This file contains 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,29 @@ | ||
package simple | ||
|
||
import weaver._ | ||
import snapshot4s.weaver.SnapshotExpectations | ||
import snapshot4s.generated.snapshotConfig | ||
|
||
object SimpleTest extends SimpleIOSuite with SnapshotExpectations { | ||
|
||
test("inline") { | ||
assertInlineSnapshot(1, 2) | ||
} | ||
|
||
test("new inline snapshot") { | ||
assertInlineSnapshot(1, ???) | ||
} | ||
|
||
test("file that doesn't exist") { | ||
assertFileSnapshot("contents", "nonexistent-file") | ||
} | ||
|
||
test("existing file") { | ||
assertFileSnapshot("contents", "existing-file") | ||
} | ||
|
||
test("file in nested directory") { | ||
assertFileSnapshot("contents", "nested-directory/nested-file") | ||
} | ||
|
||
} |