Skip to content

Commit

Permalink
feat: change window to self for webworker support
Browse files Browse the repository at this point in the history
  • Loading branch information
dryajov authored and dignifiedquire committed Feb 8, 2017
1 parent c2903ea commit ad972fe
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
},
"homepage": "https://github.com/ipfs/js-ipfs-bitswap#readme",
"devDependencies": {
"aegir": "9.4.0",
"aegir": "^10.0.0",
"benchmark": "^2.1.3",
"buffer-loader": "0.0.1",
"chai": "^3.5.0",
Expand Down Expand Up @@ -85,4 +85,4 @@
"greenkeeperio-bot <[email protected]>",
"npmcdn-to-unpkg-bot <[email protected]>"
]
}
}
8 changes: 4 additions & 4 deletions test/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ const pull = require('pull-stream')

const repoContext = require.context('buffer!./test-repo', true)

const idb = window.indexedDB ||
window.mozIndexedDB ||
window.webkitIndexedDB ||
window.msIndexedDB
const idb = self.indexedDB ||
self.mozIndexedDB ||
self.webkitIndexedDB ||
self.msIndexedDB

// book keeping
let dbs = []
Expand Down
3 changes: 2 additions & 1 deletion test/types/message.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ const protobuf = require('protocol-buffers')
const map = require('async/map')
const pbm = protobuf(require('../../src/types/message/message.proto'))
const CID = require('cids')
const isNode = require('detect-node')

const loadFixture = require('aegir/fixtures')
const testDataPath = '../test-data/serialized-from-go'
const testDataPath = (isNode ? '../' : '') + 'test-data/serialized-from-go'
const rawMessageFullWantlist = loadFixture(__dirname, testDataPath + '/bitswap110-message-full-wantlist')
const rawMessageOneBlock = loadFixture(__dirname, testDataPath + '/bitswap110-message-one-block')

Expand Down

0 comments on commit ad972fe

Please sign in to comment.