Skip to content

Commit

Permalink
POC for writing JS tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
schnatterer committed Aug 29, 2020
1 parent dc2c186 commit b35ee70
Show file tree
Hide file tree
Showing 6 changed files with 6,293 additions and 1,648 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,28 @@ adb connect <ip address>:5555

See https://stackoverflow.com/a/3623727

# Web development

```bash
npm run watch
```

Then deploy app. In future we should provide a development server.

## Tests

```bash
./gradlew connectedCheck
```

to run all tests, or

```bash
npm run test
```

to run JS tests only.

## Logging

The app writes a log file to the SD card: `/storage/sdcard0/pmcaFilesystemServer/LOG.TXT`.
Expand Down
17 changes: 16 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,20 @@ task webpack(type: NpmTask) {
args = ['run', 'build']
}

task jest(type: NpmTask) {
def jsSrcDir = "${rootDir}/app/src/main/js/"
def jsTestDir = "${rootDir}/app/src/test/js/"
def jsCoverageDir = "${buildDir}/coverage"

inputs.files('package.json', 'package-lock.json')
inputs.dir jsTestDir
inputs.dir jsSrcDir

outputs.dir jsCoverageDir

args = ['run', 'test']
}

preBuild.dependsOn npmInstall
npmInstall.finalizedBy copyNpmAssets, webpack
npmInstall.finalizedBy copyNpmAssets, webpack
connectedCheck.finalizedBy jest
Loading

0 comments on commit b35ee70

Please sign in to comment.