Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tido64 committed Dec 5, 2022
1 parent d73c46c commit 03ed6d1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ class PathUtilsTest {
assertEquals(localFile, findPackageJsonFile(project, extension))
}

@Test(expected = FileNotFoundException::class)
@Test
fun readPackageJsonFile_withMissingFile_returnsNull() {
val moduleFolder = tempFolder.newFolder("awesome-module")
val project = ProjectBuilder.builder().withProjectDir(moduleFolder).build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,12 @@ class ProjectUtilsTest {

assertFalse(project.needsCodegenFromPackageJson(model))
}

@Test
fun needsCodegenFromPackageJson_withMissingPackageJson_returnsFalse() {
val project = createProject()
val extension = TestReactExtension(project)

assertFalse(project.needsCodegenFromPackageJson(extension))
}
}

0 comments on commit 03ed6d1

Please sign in to comment.