Skip to content

Commit

Permalink
build: generate debug artifacts too virtualfs-debug.js and virtualfs-…
Browse files Browse the repository at this point in the history
…debug.map.js
  • Loading branch information
abose committed Sep 19, 2023
1 parent bf77daa commit f55b6fa
Show file tree
Hide file tree
Showing 12 changed files with 20,484 additions and 39 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ src/**/*-min.js
src/**/*.min.js
test/virtualfs.js
test/virtualfs.js.map
test/virtualfs-debug.js
test/virtualfs-debug.js.map
2 changes: 1 addition & 1 deletion .github/workflows/test-on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
run: |
npm install
echo "npm run build not executed as we will be running tests against the checked in release artifacts only!"
npm run _copy-test-dist
npm run _copy-dist-to-test
npm run tauri build
- name: Run tauri integration tests in ubuntu
if: matrix.platform == 'ubuntu-latest'
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@ dist/*
!dist/phoenix-fs.js
test/virtualfs.js
test/virtualfs.js.map

!dist/virtualfs-debug.js
!dist/virtualfs-debug.js.map
test/virtualfs-debug.js
test/virtualfs-debug.js.map

phcode-fs-*.tgz
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,27 +234,35 @@ To build it:

```bash
npm install
npm run build:dev
npm run build
```

The `npm run build` command will create two files `dist/virtualfs.js` and `dist/virtualfs-debug.js`.
Use `dist/virtualfs-debug.js` if you want to debug the phoenix filesystem lib itself.

## Tests in Browser
While developing, use test script to open browser tests.
* Test runs tests against the built artifacts in dist folder.
* You should `npm run build` if any changes were made to the src folder
```bash
npm run build:dev
npm run build
npm run test-browser
```

NOTE: you can also use `npm run serve` to also start a web server for development.

### Debug Symbols in tests.
By default, tests are run against the release build `test/virtualfs.js`. As it is heavily optimized it might be hard to debug with the release lib.

If you want to debug the tests with more debug symbols, search for `<script src="virtualfs-debug.js"></script>` in file `test/index.html` and follow steps there.

## Tests in tauri
Again, Test runs tests against the built artifacts in dist folder.
To develop tests in tauri, run the following commands:
1. First, build the artifacts in the `dist` folder by running:

```bash
npm run build:dev
npm run build
```

2. Next, initiate the tests by executing:
Expand Down
Loading

0 comments on commit f55b6fa

Please sign in to comment.