flow-enums-runtime
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -105,6 +105,18 @@ /** | ||
test('members', () => { | ||
test('members iterable', () => { | ||
expect(Array.from(E.members())).toEqual([1, 2]); | ||
let i = 1; | ||
for (const x of E.members()) { | ||
expect(x).toEqual(i); | ||
i++; | ||
} | ||
}); | ||
test('members iterator', () => { | ||
const iter = E.members(); | ||
expect(iter.next()).toEqual({value: 1, done: false}); | ||
expect(iter.next()).toEqual({value: 2, done: false}); | ||
expect(iter.next()).toEqual({value: undefined, done: true}); | ||
}); | ||
test('getName', () => { | ||
@@ -215,6 +227,19 @@ expect(E.getName(E.A)).toBe('A'); | ||
test('members', () => { | ||
expect(Array.from(E.members())).toEqual(['A', 'B']); | ||
test('members iterable', () => { | ||
const expected = ['A', 'B']; | ||
expect(Array.from(E.members())).toEqual(expected); | ||
let i = 0; | ||
for (const x of E.members()) { | ||
expect(x).toEqual(expected[i]); | ||
i++; | ||
} | ||
}); | ||
test('members iterator', () => { | ||
const iter = E.members(); | ||
expect(iter.next()).toEqual({value: 'A', done: false}); | ||
expect(iter.next()).toEqual({value: 'B', done: false}); | ||
expect(iter.next()).toEqual({value: undefined, done: true}); | ||
}); | ||
test('getName', () => { | ||
@@ -221,0 +246,0 @@ expect(E.getName(E.A)).toBe('A'); |
@@ -92,3 +92,3 @@ /** | ||
// properties, and our properties aren't enumerable. | ||
return Object.getOwnPropertyNames(this); | ||
return Object.getOwnPropertyNames(this).values(); | ||
}, | ||
@@ -95,0 +95,0 @@ }, |
{ | ||
"name": "flow-enums-runtime", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "Runtime to be use with the Flow Enums transform.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11436
7
338