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:
2017-02-17 21:30:53 +08:00
parent 0bf09fbe49
commit fe356429fe
3 changed files with 13 additions and 2 deletions
+2 -2
View File
@@ -17,13 +17,13 @@ export default Ember.Service.extend({
storeFile(content) {
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;
});
},
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();
});
}
+9
View File
@@ -21,6 +21,15 @@ module.exports = function(environment) {
// when it is created
},
browserify: {
transform: [
["babelify", {
presets: ["es2015"],
global: true
}]
]
},
web3ProviderUrl: "https://parity.kosmos.org:8545",
ethereumChain: "testnet",
ipfs: {
+2
View File
@@ -19,6 +19,8 @@
"deploy": "npm run build-prod && npm run update-version-file && bash scripts/deploy.sh"
},
"devDependencies": {
"babel-preset-es2015": "^6.22.0",
"babelify": "^7.3.0",
"broccoli-asset-rev": "^2.4.5",
"ember-ajax": "^2.4.1",
"ember-browserify": "^1.1.13",