diff --git a/.gitattributes b/.gitattributes index 7b4ffdca..07736716 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,4 @@ * text=auto eol=lf *.jar binary -*.png binary \ No newline at end of file +*.png binary +*.webp binary \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a2a3d9f9..ef748025 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install JDK ${{ matrix.jre }} uses: actions/setup-java@v3 with: @@ -33,7 +33,7 @@ jobs: - name: gradlew build run: ./gradlew build - name: junit result - uses: mikepenz/action-junit-report@v3 + uses: mikepenz/action-junit-report@v4 if: always() # always run even if the previous step fails with: check_name: JUnit ${{ matrix.jre }} ${{ matrix.os }} diff --git a/.github/workflows/publish-kdoc.yml b/.github/workflows/publish-kdoc.yml new file mode 100644 index 00000000..cb7c827f --- /dev/null +++ b/.github/workflows/publish-kdoc.yml @@ -0,0 +1,30 @@ +on: workflow_dispatch + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + deployments: write + name: Publish to Cloudflare Pages + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Install JDK 17 + uses: actions/setup-java@v3 + with: + distribution: "temurin" + java-version: 17 + - name: Gradle caching + uses: gradle/gradle-build-action@v2 + with: + gradle-home-cache-cleanup: true + - name: Build + run: ./gradlew :dokkatooGeneratePublicationHtml + - name: Publish to Cloudflare Pages + uses: cloudflare/pages-action@v1 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: 0a95e814ccf2b6a95d2dc3bea0a4a2b4 + projectName: selfie-kdoc + directory: build/dokka/html diff --git a/.gitignore b/.gitignore index 573e8471..b8c42e51 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ .idea/ .gradle/ build/ +bin/ +.DS_Store \ No newline at end of file diff --git a/README.md b/README.md index af6dc620..00698a6f 100644 --- a/README.md +++ b/README.md @@ -1,98 +1,11 @@ -# Selfie +# Selfie -- Precise snapshot testing for the JVM and Javascript (others TBD) -- Supports text and binary data. -- Friendly to humans and version control. -- In-place [literal snapshots](#literal-snapshots). -- Allows [lenses](#lenses) to verify multiple aspects of an object under test. - - e.g. pretty-printed JSON, or only the rendered plaintext of an HTML document, etc. +Snapshot testing is the fastest and most precise mechanism to record and specify the behavior of your system and its components. -ere is a very simple test which snapshots the HTML served at various URLs. +Robots are writing their own code. Are you still writing assertions by hand? -```java -@Test public void gzipFavicon() { - expectSelfie(get("/favicon.ico", ContentEncoding.GZIP)).toMatchDisk(); -} -@Test public void orderFlow() { - expectSelfie(get("/orders")).toMatchDisk("initial"); - postOrder(); - expectSelfie(get("/orders")).toMatchDisk("ordered"); -} -``` - -This will generate a snapshot file like so: - -``` -╔═ gzipFavicon ═╗ base64 length 823 bytes -H4sIAAAAAAAA/8pIzcnJVyjPL8pJUQQAlQYXAAAA -╔═ orderFlow/initial ═╗ -
- - -╔═ orderFlow/ordered ═╗ - -Thanks for your business!
-Tracking #ABC123
-Thanks for your business!
-Tracking #ABC123
-+ snapshot testing for +
+
+ Which is
{" "}
+
and
+ Snapshot testing is the
{" "}
+ fastest and most precise
+
+ mechanism to{" "}
+
+ record
and specify
+ {" "}
+ the
+
+ behavior of your
+ system and its
+ components
+
+ .
+
+ Robots are
writing their
+ own code. Are
+
you still writing
+
+ assertions by
+ hand?
+
+ ) : (
+
+ );
+}
+
+export function pre({ children, ...props }: ParentComponentProps) {
+ return (
+ + {children} ++
+ {children} +
+ ); +} + +export function h2({ children, ...props }: ParentComponentProps) { + return ( + <> +Thanks for your business!
+Tracking #ABC123
+Thanks for your business!
+Tracking #ABC123
+