-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
/
index.js
38 lines (31 loc) · 928 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { test } from "./file";
it("should hide import by local var", function() {
var test = "ok";
test.should.be.eql("ok");
});
it("should hide import by object pattern", function() {
var { test } = { test: "ok" };
test.should.be.eql("ok");
});
it("should hide import by array pattern", function() {
var [test] = ["ok"];
test.should.be.eql("ok");
});
it("should hide import by array pattern (nested)", function() {
var [[test]] = [["ok"]];
test.should.be.eql("ok");
});
it("should hide import by pattern in function", function() {
(function({test}) {
test.should.be.eql("ok");
}({ test: "ok" }));
});
it("should allow import in default (incorrect)", function() {
var { other = test, test } = { test: "ok" };
test.should.be.eql("ok");
(typeof other).should.be.eql("undefined");
});
it("should allow import in default", function() {
var { other = test } = { test: "ok" };
other.should.be.eql("test");
});