Skip to content

Commit bb53546

Browse files
js tests
1 parent 8c2d599 commit bb53546

4 files changed

Lines changed: 42 additions & 8 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Tests :shared JS Browser
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- trunk
8+
9+
jobs:
10+
web-build-html-js:
11+
runs-on: macos-11
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2.3.1
15+
16+
- name: Set up JDK 11
17+
uses: actions/setup-java@v1
18+
with:
19+
java-version: 11
20+
21+
- name: Tests :shared
22+
run: |
23+
cd project-files/Portfolio
24+
./gradlew :shared:cleanJsBrowserTest :shared:jsBrowserTest --stacktrace

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
![](https://github.com/amanshuraikwar/amanshuraikwar.github.io/actions/workflows/build-web-html-js.yml/badge.svg)
88
       
99
<a href="https://amanshuraikwar.github.io/tests/shared/android-jvm/">![](https://github.com/amanshuraikwar/amanshuraikwar.github.io/actions/workflows/shared-tests-android-jvm.yml/badge.svg)</a>
10+
&nbsp; &nbsp; &nbsp; &nbsp;
11+
<a href="https://amanshuraikwar.github.io/tests/shared/js-browser/">![](https://github.com/amanshuraikwar/amanshuraikwar.github.io/actions/workflows/shared-tests-js-browser.yml/badge.svg)</a>
1012

1113
</p>
1214

project-files/Portfolio/buildWebsite.kts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,25 @@ File(".") exec "cp -R build/home/ build/"
5151
println("Deleting build/home...")
5252
File(".") exec "rm -rf build/home"
5353

54-
println("Running theme data tests in :shared for Android/JVM target...")
55-
File(".") exec "./gradlew :shared:cleanTestDebugUnitTest :shared:testDebugUnitTest"
5654
println("Creating directory build/tests...")
5755
File(".") exec "mkdir build/tests"
5856
println("Creating directory build/tests/shared...")
5957
File(".") exec "mkdir build/tests/shared"
58+
59+
println("Running theme data tests in :shared for Android/JVM target...")
60+
File(".") exec "./gradlew :shared:cleanTestDebugUnitTest :shared:testDebugUnitTest"
6061
println("Creating directory build/tests/shared/android-jvm...")
6162
File(".") exec "mkdir build/tests/shared/android-jvm"
6263
println("Copying contents from shared/build/reports/tests/testDebugUnitTest/ to build/tests/shared/android-jvm/...")
6364
File(".") exec "cp -R shared/build/reports/tests/testDebugUnitTest/ build/tests/shared/android-jvm/"
6465

66+
println("Running theme data tests in :shared for Js Browser...")
67+
File(".") exec "./gradlew :shared:cleanJsBrowserTest :shared:jsBrowserTest --stacktrace"
68+
println("Creating directory build/tests/shared/js-browser...")
69+
File(".") exec "mkdir build/tests/shared/js-browser"
70+
println("Copying contents from shared/build/reports/tests/jsBrowserTest/ to build/tests/shared/js-browser/...")
71+
File(".") exec "cp -R shared/build/reports/tests/jsBrowserTest/ build/tests/shared/js-browser/"
72+
6573
data class BlogListEntry(
6674
val title: String,
6775
val date: String,

project-files/Portfolio/shared/src/commonMain/kotlin/io/github/amanshuraikwar/portfolio/BlogListDataStore.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ class BlogListDataStore {
66

77
fun getBlogListData(): List<BlogListDataItem> {
88
return listOf(
9+
BlogListDataItem(
10+
title = "My Portfolio",
11+
date = "December 25, 2021",
12+
firstParagraph = "This is my portfolio. It is a KMM project which runs on Web, Android, iOS. The business logic is written in Kotlin. The Web app is written in Kotlin, built using Jetpack Compose for Web. The Android app is written in Kotlin, built using Jetpack Compose. The iOS app UI is written in Swift, built using Swift UI and it uses the KMM shared module for business logic.",
13+
link = "https://amanshuraikwar.github.io/portfolio",
14+
),
915
BlogListDataItem(
1016
title = "How to use highlight.js in your Jetpack Compose Web project",
1117
date = "December 14, 2021",
@@ -18,12 +24,6 @@ class BlogListDataStore {
1824
firstParagraph = "If you are writing unit tests for your Kotlin project and need to mock certain objects, there is high chance that you are using MockK. Here are a couple of issues that I faced while using MockK in my KMM project. The project has Android and iOS apps with business logic written in shared KMM modules, I was writing unit tests to test this business logic.",
1925
link = "https://amanshuraikwar.github.io/mockk-kmm-issues",
2026
),
21-
BlogListDataItem(
22-
title = "My Portfolio",
23-
date = "December 11, 2021",
24-
firstParagraph = "This is my portfolio. It is a KMM project which runs on Web, Android, iOS. The business logic is written in Kotlin. The Web app is written in Kotlin, built using Jetpack Compose for Web. The Android app is written in Kotlin, built using Jetpack Compose. The iOS app UI is written in Swift, built using Swift UI and it uses the KMM shared module for business logic.",
25-
link = "https://amanshuraikwar.github.io/portfolio",
26-
),
2727
BlogListDataItem(
2828
title = "Introducing Next Bus SG",
2929
date = "December 8, 2021",

0 commit comments

Comments
 (0)