Skip to content

Commit

Permalink
wtf destruct
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanong committed Sep 12, 2014
1 parent 3bf33b1 commit 21f5108
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/fixtures/destruct-stuff.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@


var [a, b] = [1, 2];

[].filter( x => x);
26 changes: 26 additions & 0 deletions test/js.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,32 @@ describe('Ecstacy.js(code, map)', function () {
})
})

describe('destruct-stuff.js', function () {
var ecstacy = Ecstacy.js({
name: 'destruct-stuff',
code: fixture('destruct-stuff'),
transforms: true
})
var data

it('.then( data => )', function () {
return ecstacy.build().then(function( _data) {
assert(data = _data)
assert(data.name)
assert(data.date)
assert(data.hash)
assert(data.length)
assert(data.length['.js'])
})
})

it('.read(name, .js)', function () {
return ecstacy.read(data.name, '.js', 'utf8').then(function (js) {
assert(!~js.indexOf('var [a, b]'))
})
})
})

describe('arrows.js', function () {
var ecstacy = Ecstacy.js({
name: 'arrow',
Expand Down

0 comments on commit 21f5108

Please sign in to comment.