git clone <repository-url>
cd ember-browser-services
pnpm install
pnpm run lint:hbs
pnpm run lint:js
pnpm run lint:js --fix
ember test
– Runs the test suite on the current Ember versionember test --server
– Runs the test suite in "watch mode"ember try:each
– Runs the test suite against multiple Ember versions
ember serve
- Visit the dummy application at http://localhost:4200.
For more information on using ember-cli, visit https://ember-cli.com/.
Want to add a new API? such as document, navigator, ServiceWorker, etc? why weren't these added initially? Time. ;)
inside the addon root, run ember g service browser/navigator
where navigator
is the name of the API you wish to proxy and mock in tests.
then, the file only needs to have an import and a default export:
import { proxyService } from 'ember-browser-services/utils/proxy-service';
export default proxyService(navigator);
This serves as the default implementation that your apps will use and is only a Proxy to the real thing.
Lastly, in addon-test-support/index.ts
, add a registration for the new service.