make browser tests work by including testdata
...testdata was not being loaded correctly by the new browserify.js file, and thus not all the tests were working. I have fixed this by including "testdata" as one of the modules that is compiled by the browserify.js script.
This commit is contained in:
parent
c19fb7a3ce
commit
0adbc55e82
16
Gruntfile.js
16
Gruntfile.js
|
@ -18,22 +18,8 @@ module.exports = function(grunt) {
|
|||
command: 'node ./browserify.js > browser/bundle.js',
|
||||
},
|
||||
browserifyData: {
|
||||
options: {
|
||||
stdout: true
|
||||
command: 'browserify -t brfs -s testdata test/testdata.js -o browser/testdata.js'
|
||||
},
|
||||
command: 'browserify -t brfs test/testdata.js > browser/testdata.js'
|
||||
},
|
||||
},
|
||||
browserify: {
|
||||
test_data: {
|
||||
src: ['test/testdata.js'],
|
||||
dest: 'browser/testdata.js',
|
||||
options: {
|
||||
transform: ['brfs'],
|
||||
debug: true,
|
||||
standalone: 'testdata',
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
readme: {
|
||||
|
|
|
@ -267,7 +267,7 @@ Bitcore needs some developer love. Please send pull requests for bug fixes, code
|
|||
Work to enable Bitcore for use in the browser is ongoing. To build bitcore for the browser:
|
||||
```
|
||||
npm install -g grunt-cli
|
||||
grunt browserify
|
||||
grunt shell
|
||||
```
|
||||
|
||||
You can check a usage example at examples/example.html
|
||||
|
|
|
@ -66,12 +66,15 @@ b.require('./util/util');
|
|||
b.require('./util/EncodedData');
|
||||
b.require('./util/VersionedData');
|
||||
b.add('./browser/bignum_config.js');
|
||||
b.require('./test/testdata.js', {expose: './testdata'});
|
||||
b.transform('brfs');
|
||||
|
||||
modules.forEach(function(m) {
|
||||
b.require('./' + m + '.js' ,{expose:m} );
|
||||
});
|
||||
|
||||
var bopts = {
|
||||
transform: ['brfs']
|
||||
// detectGlobals: true,
|
||||
// insertGlobals: 'Buffer',
|
||||
// insertGlobalVars: {
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
<script src="../node_modules/chai/chai.js"></script>
|
||||
<script>mocha.setup('bdd')</script>
|
||||
<script src="../browser/bundle.js"></script>
|
||||
<script src="../browser/testdata.js"></script>
|
||||
|
||||
<script>
|
||||
var bitcore = require('bitcore');
|
||||
|
|
Loading…
Reference in New Issue