Skip to content

Commit

Permalink
Migration test and log
Browse files Browse the repository at this point in the history
  • Loading branch information
keynmol committed Mar 24, 2024
1 parent 9a1c07c commit d0d293c
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Expand Up @@ -3,6 +3,8 @@
- [Installation (SBT)](#installation-sbt)
- [Usage](#usage)
- [Scala.js](#scalajs)
- [Breaking changes log](#breaking-changes-log)
- [0.0.6](#006)
<!--toc:end-->


Expand Down Expand Up @@ -94,3 +96,16 @@ for example commonJS:
```scala
scalaJSLinkerConfig ~= (_.withModuleKind(ModuleKind.CommonJSModule))
```


### Breaking changes log

#### 0.0.6

Snapshots moved from `src/test/resources/snapshots` to `src/snapshots`.
This was done because writing to `test/resources` re-triggers file watching
when you run `~test`.

You can return old behaviour by manually configuring new setting `snapshotsLocation`.

You can automatically move all the snapshots by running `snapshotsMigrate 0.0.6`
@@ -0,0 +1,15 @@
lazy val root = projectMatrix
.in(file("."))
.jvmPlatform(Seq("3.3.1", "2.13.12"))
.nativePlatform(Seq("3.3.1"))
.jsPlatform(Seq("3.3.1"))
.settings(
snapshotsPackageName := "example.bla",
snapshotsIntegrations += SnapshotIntegration.MUnit,
libraryDependencies +=
"org.scalameta" %%% "munit" % "1.0.0-M7" % Test,
scalaJSLinkerConfig ~= (_.withModuleKind(ModuleKind.CommonJSModule)),
snapshotsForceOverwrite := true,
)
.enablePlugins(SnapshotsPlugin)

@@ -0,0 +1,6 @@
addSbtPlugin(
"com.indoorvivants.snapshots" % "sbt-snapshots" % sys.props("plugin.version")
)
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.17")
addSbtPlugin("com.eed3si9n" % "sbt-projectmatrix" % "0.9.1")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.14.0")
@@ -0,0 +1,10 @@
package example.bla

import com.indoorvivants.snapshots.munit_integration._
import munit._

class MunitExampleTests extends FunSuite with MunitSnapshotsIntegration {
test("hello") {
assertSnapshot("my.snapshot", "hello - more stuff")
}
}
@@ -0,0 +1,13 @@
-$ exists src/snapshots/root3/my_snapshot
-$ exists src/snapshots/rootNative3/my_snapshot
-$ exists src/snapshots/rootJS3/my_snapshot
> snapshotsMigrate 0.0.6
$ exists src/snapshots/root3/my_snapshot
$ exists src/snapshots/rootNative3/my_snapshot
$ exists src/snapshots/rootJS3/my_snapshot
-$ exists src/test/resources/snapshots/root3/my_snapshot
-$ exists src/test/resources/snapshots/rootNative3/my_snapshot
-$ exists src/test/resources/snapshots/rootJS3/my_snapshot
> root3/test
> rootJS3/test
> rootNative3/test

0 comments on commit d0d293c

Please sign in to comment.