Add karma for testing (#2)

This commit is contained in:
Justin Fagnani
2019-12-17 18:54:23 -08:00
committed by GitHub
parent 2c090ee06f
commit d50f5a7c7e
8 changed files with 2788 additions and 8 deletions

View File

@@ -28,6 +28,16 @@ npm run build:watch
Both the TypeScript compiler and lit-analyzer are configured to be very strict. You may want to change `tsconfig.json` to make them less strict.
## Testing
This sample uses Karma, Chai, Mocha, and the open-wc test helpers for testing. See the [open-wc testing documentation](https://open-wc.org/testing/testing.html) for more information.
Tests can be run with the `test` script:
```bash
npm test
```
## Dev Server
This sample uses [ES dev server](https://github.com/open-wc/open-wc/tree/master/packages/es-dev-server) for previewing the project without additional build steps. ES dev server handles resolving Node-style "bare" import specifiers, which aren't supported in browsers. It also automatically transpiles JavaScript and adds polyfills to support older browsers.