Skip to content

Commit

Permalink
fix util.now
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzhenn committed Oct 4, 2017
1 parent 0aba74d commit eb99a17
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion build/karma.cover.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ module.exports = function (config) {
const babel = require('maptalks-rollup-plugin-babel');
plugins.splice(idx, 1, babel({
plugins: [['istanbul', {
exclude: ['test/**/*.js', 'src/core/mapbox/*.js', 'src/util/dom.js', 'node_modules/**/*']
// TileLayerGLRenderer is not testable on CI
exclude: ['test/**/*.js', 'src/core/mapbox/*.js', 'src/util/dom.js', 'src/renderer/layer/tilelayer/TileLayerGLRenderer', 'node_modules/**/*']
}]]
}));
}
Expand Down
3 changes: 0 additions & 3 deletions src/core/util/common.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
export function now() {
if (typeof performance !== 'undefined' && performance.now) {
return performance.now();
}
return Date.now();
}

Expand Down
7 changes: 7 additions & 0 deletions test/core/UtilSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ describe('Util', function () {
expect(maptalks.Util.sign(2)).to.be.eql(1);
});

it('now', function () {
var now = Date.now();
var now2 = maptalks.Util.now();

expect(now2 >= now).to.be.ok();
});

it('getSymbolStamp', function () {
var symbol = {
'markerType' : 'ellipse',
Expand Down

0 comments on commit eb99a17

Please sign in to comment.