Skip to content

Commit

Permalink
Merge pull request #1 from pabloascarza/remove-mocha
Browse files Browse the repository at this point in the history
build: remove mocha
  • Loading branch information
pabloascarza authored Aug 18, 2022
2 parents d004546 + 59c9ead commit 2d18294
Show file tree
Hide file tree
Showing 10 changed files with 6,680 additions and 1,974 deletions.
4 changes: 2 additions & 2 deletions addon/services/geolocation.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default class Geolocation extends Service.extend(Evented) {
trackingCallback = null;
@tracked watcherId = null;

get geolocator () {
get geolocator() {
return window.navigator.geolocation;
}

Expand Down Expand Up @@ -89,4 +89,4 @@ export default class Geolocation extends Service.extend(Evented) {
this._handleNewPosition(null);
}
}
};
}
115 changes: 115 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ember-geoservice",
"version": "1.0.1",
"version": "1.1.0",
"description": "Geolocation service for Ember.js web apps",
"keywords": [
"ember-addon",
Expand Down Expand Up @@ -33,8 +33,7 @@
},
"dependencies": {
"ember-cli-babel": "7.26.10",
"ember-cli-htmlbars": "^5.7.2",
"ember-mocha": "^0.16.2"
"ember-cli-htmlbars": "^5.7.2"
},
"devDependencies": {
"@ember/optional-features": "2.0.0",
Expand Down Expand Up @@ -72,7 +71,8 @@
"loader.js": "^4.7.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.5.1",
"qunit": "^2.17.2"
"qunit": "^2.17.2",
"qunit-dom": "^1.6.0"
},
"engines": {
"node": "12.* || 14.* || >= 16"
Expand Down
32 changes: 17 additions & 15 deletions tests/dummy/app/components/geolocation-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default class GeolocationTest extends Component {

@action getUserLocation() {
this.showLoader = true;
this.geolocation.getLocation({timeout:10000}).then(
this.geolocation.getLocation({ timeout: 10000 }).then(
() => {
this.showLoader = false;
let currentLocation = this.geolocation.currentLocation;
Expand All @@ -26,21 +26,23 @@ export default class GeolocationTest extends Component {

@action trackUserLocation() {
this.showLoader = true;
this.geolocation.trackLocation({timeout:10000}, this.trackedCallback).then(
() => {
this.showLoader = false;
let currentLocation = this.geolocation.currentLocation;
this.userLocation = currentLocation;
},
(reason) => {
this.showLoader = false;
// eslint-disable-next-line no-console
console.error('Geolocation failed because ' + reason);
}
);
this.geolocation
.trackLocation({ timeout: 10000 }, this.trackedCallback)
.then(
() => {
this.showLoader = false;
let currentLocation = this.geolocation.currentLocation;
this.userLocation = currentLocation;
},
(reason) => {
this.showLoader = false;
// eslint-disable-next-line no-console
console.error('Geolocation failed because ' + reason);
}
);
}

trackedCallback () {
trackedCallback() {
window.alert('Being tracked');
}
}
}
8 changes: 4 additions & 4 deletions tests/dummy/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">

{{content-for 'head'}}
{{content-for "head"}}

<link integrity="" rel="stylesheet" href="{{rootURL}}assets/vendor.css">
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/dummy.css">

{{content-for 'head-footer'}}
{{content-for "head-footer"}}
</head>
<body>
{{content-for 'body'}}
{{content-for "body"}}

<script src="{{rootURL}}assets/vendor.js"></script>
<script src="{{rootURL}}assets/dummy.js"></script>

{{content-for 'body-footer'}}
{{content-for "body-footer"}}
</body>
</html>
1 change: 1 addition & 0 deletions tests/dummy/app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ export default class Router extends EmberRouter {
rootURL = config.rootURL;
}

Router.map(function () {});
4 changes: 2 additions & 2 deletions tests/dummy/config/ember-cli-update.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"codemodsSource": "ember-addon-codemods-manifest@1",
"isBaseBlueprint": true,
"options": [
"--yarn",
"--no-welcome"
"--welcome",
"--yarn"
]
}
]
Expand Down
7 changes: 5 additions & 2 deletions tests/test-helper.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import Application from 'dummy/app';
import config from 'dummy/config/environment';
import * as QUnit from 'qunit';
import { setApplication } from '@ember/test-helpers';
import { start } from 'ember-mocha';
import { setup } from 'qunit-dom';
import { start } from 'ember-qunit';

setApplication(Application.create(config.APP));
start();

setup(QUnit.assert);

start();
Loading

0 comments on commit 2d18294

Please sign in to comment.