Skip to content

Commit

Permalink
Fix tests - Date.now() was too slow for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
1999 committed Oct 14, 2014
1 parent 469ea09 commit 7bf2777
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,7 @@
* new: CommonJS module syntax support
* new: `skladConnection.close()` method to explicitly close existing connection ([#3](https://github.com/1999/sklad/issues/3))
* new: semver support
* new: `blocked` event support with `InvalidStateError` DOMError
* fix: callbacks with errors could run more than once
* fix: external docs page contains close to truth examples ([#2](https://github.com/1999/sklad/issues/2))
* **breaking change**: callbacks are now invoked with [DOMError](https://developer.mozilla.org/en/docs/Web/API/DOMError) instance as a first argument if error happens during operation, previously it could be either `String` or `Error`. Check out [docs](https://github.com/1999/sklad/tree/master/docs) for examples.
Expand Down
2 changes: 1 addition & 1 deletion tests/clear.js
@@ -1,5 +1,5 @@
describe('Clear operations', function () {
var dbName = 'dbName' + Date.now();
var dbName = 'dbName' + Math.random();
var conn;

function openConnection(cb) {
Expand Down
2 changes: 1 addition & 1 deletion tests/close.js
@@ -1,5 +1,5 @@
describe('Close operation', function () {
var dbName = 'dbName' + Date.now();
var dbName = 'dbName' + Math.random();

it('should free IDBDatabase object after closing database', function (done) {
sklad.open(dbName, function (err, connection) {
Expand Down
2 changes: 1 addition & 1 deletion tests/count.js
@@ -1,5 +1,5 @@
describe('Count operations', function () {
var dbName = 'dbName' + Date.now();
var dbName = 'dbName' + Math.random();
var conn;

function openConnection(cb) {
Expand Down
2 changes: 1 addition & 1 deletion tests/delete.js
@@ -1,5 +1,5 @@
describe('Delete operations', function () {
var dbName = 'dbName' + Date.now();
var dbName = 'dbName' + Math.random();
var conn;

function openConnection(cb) {
Expand Down
2 changes: 1 addition & 1 deletion tests/get.js
@@ -1,5 +1,5 @@
describe('Get operations', function () {
var dbName = 'dbName' + Date.now();
var dbName = 'dbName' + Math.random();
var conn;

function openConnection(cb) {
Expand Down
2 changes: 1 addition & 1 deletion tests/insert.js
@@ -1,5 +1,5 @@
describe('Insert operations', function () {
var dbName = 'dbName' + Date.now();
var dbName = 'dbName' + Math.random();
var conn;

function openConnection(cb) {
Expand Down
2 changes: 1 addition & 1 deletion tests/test_utils.js
Expand Up @@ -41,7 +41,7 @@ function openBaseConnection(dbName, cb) {
}

function runCommonAddTests(method) {
var dbName = 'dbName' + Date.now();
var dbName = 'dbName' + Math.random();
var conn;

function openConnection(cb) {
Expand Down
2 changes: 1 addition & 1 deletion tests/upsert.js
@@ -1,5 +1,5 @@
describe('Upsert operations', function () {
var dbName = 'dbName' + Date.now();
var dbName = 'dbName' + Math.random();
var conn;

function openConnection(cb) {
Expand Down

0 comments on commit 7bf2777

Please sign in to comment.