forked from minio/minio-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setting up babel for ES6 compilation
- Loading branch information
Frederick F. Kautz IV
committed
May 24, 2015
1 parent
9be7eb2
commit 7569e66
Showing
5 changed files
with
83 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
var gulp = require('gulp') | ||
var babel = require('gulp-babel') | ||
var mocha = require('gulp-mocha') | ||
var concat = require('gulp-concat') | ||
var sourcemaps = require('gulp-sourcemaps') | ||
//var sourcemaps = require('gulp-sourcemaps') | ||
|
||
gulp.task('default', ['test'], function() { | ||
}) | ||
|
||
gulp.task('compile', function(cb) { | ||
gulp.src('src/**/*.js') | ||
.pipe(sourcemaps.init()) | ||
.pipe(concat('minio.js')) | ||
.pipe(babel()) | ||
.pipe(sourcemaps.write('.')) | ||
.pipe(gulp.dest('dist/main')) | ||
.on('end', function() { | ||
cb() | ||
}) | ||
}) | ||
|
||
gulp.task('test:compile', function(cb) { | ||
gulp.src('test/**/*.js') | ||
.pipe(sourcemaps.init()) | ||
.pipe(concat('minio-test.js')) | ||
.pipe(babel()) | ||
.pipe(sourcemaps.write('.')) | ||
.pipe(gulp.dest('dist/test')) | ||
.on('end', function() { | ||
cb() | ||
}) | ||
}) | ||
|
||
gulp.task('test',['compile', 'test:compile'], function () { | ||
gulp.src('dist/test/*.js', {read: false}) | ||
.pipe(mocha({reporter: 'nyan'})) | ||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class Minio { | ||
getClient() { | ||
return "hello"; | ||
} | ||
} | ||
var inst = new Minio(); | ||
module.exports = inst; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
require('source-map-support').install(); | ||
|
||
var assert = require('assert'); | ||
var minio = require('../..'); | ||
|
||
describe('Object Storage Client', function () { | ||
"use strict"; | ||
describe("#getClient()", function () { | ||
it('should return a client', function () { | ||
var client = minio.getClient(); | ||
assert.equal('hello', client); | ||
}) | ||
it('should return index when the value is not present', function () { | ||
assert.equal(0, [2, 3, 4].indexOf(2)) | ||
}) | ||
}) | ||
} | ||
) |