Fix tests
One can use transforms with Browserify, so I added babelify in order to compile all node modules to ES5.
This commit is contained in:
@@ -17,13 +17,13 @@ export default Ember.Service.extend({
|
|||||||
|
|
||||||
storeFile(content) {
|
storeFile(content) {
|
||||||
let ipfs = this.get('ipfs');
|
let ipfs = this.get('ipfs');
|
||||||
return ipfs.add(new ipfs.Buffer(content)).then((res) => {
|
return ipfs.add(new ipfs.Buffer(content)).then(res => {
|
||||||
return res[0].hash;
|
return res[0].hash;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
getFile(hash) {
|
getFile(hash) {
|
||||||
return this.get('ipfs').cat(hash, { buffer: true }).then(res) => {
|
return this.get('ipfs').cat(hash, { buffer: true }).then(res => {
|
||||||
return res.toString();
|
return res.toString();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,15 @@ module.exports = function(environment) {
|
|||||||
// when it is created
|
// when it is created
|
||||||
},
|
},
|
||||||
|
|
||||||
|
browserify: {
|
||||||
|
transform: [
|
||||||
|
["babelify", {
|
||||||
|
presets: ["es2015"],
|
||||||
|
global: true
|
||||||
|
}]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
web3ProviderUrl: "https://parity.kosmos.org:8545",
|
web3ProviderUrl: "https://parity.kosmos.org:8545",
|
||||||
ethereumChain: "testnet",
|
ethereumChain: "testnet",
|
||||||
ipfs: {
|
ipfs: {
|
||||||
|
|||||||
@@ -19,6 +19,8 @@
|
|||||||
"deploy": "npm run build-prod && npm run update-version-file && bash scripts/deploy.sh"
|
"deploy": "npm run build-prod && npm run update-version-file && bash scripts/deploy.sh"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"babel-preset-es2015": "^6.22.0",
|
||||||
|
"babelify": "^7.3.0",
|
||||||
"broccoli-asset-rev": "^2.4.5",
|
"broccoli-asset-rev": "^2.4.5",
|
||||||
"ember-ajax": "^2.4.1",
|
"ember-ajax": "^2.4.1",
|
||||||
"ember-browserify": "^1.1.13",
|
"ember-browserify": "^1.1.13",
|
||||||
|
|||||||
Reference in New Issue
Block a user