Skip to content

Commit

Permalink
Use native Symbol in test
Browse files Browse the repository at this point in the history
  • Loading branch information
leebyron committed Apr 18, 2016
1 parent a15e4ba commit 1269d45
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
10 changes: 6 additions & 4 deletions __tests__/Conversion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ jasmineCheck.install();

import { Map, OrderedMap, List, Record, is, fromJS } from 'immutable';

import core = require('core-js/library');

declare function expect(val: any): ExpectWithIs;

interface ExpectWithIs extends Expect {
is(expected: any): void;
not: ExpectWithIs;
}

// Symbols
declare function Symbol(name: string): Object;

describe('Conversion', () => {

beforeEach(function () {
Expand Down Expand Up @@ -175,8 +176,9 @@ describe('Conversion', () => {

it('Explicitly convert values to string using String constructor', () => {
expect(() => {
fromJS({foo: core.Symbol('bar')}) + '';
Map().set('foo', core.Symbol('bar')) + '';
fromJS({ foo: Symbol('bar') }) + '';
Map().set('foo', Symbol('bar')) + '';
Map().set(Symbol('bar'), 'foo') + '';
}).not.toThrow();
});

Expand Down
2 changes: 1 addition & 1 deletion dist/immutable.js
Original file line number Diff line number Diff line change
Expand Up @@ -4907,7 +4907,7 @@
}

function quoteString(value) {
return typeof value === 'string' ? JSON.stringify(value) : value;
return typeof value === 'string' ? JSON.stringify(value) : String(value);
}

function defaultZipper() {
Expand Down
2 changes: 1 addition & 1 deletion dist/immutable.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"browser-sync": "2.11.0",
"browserify": "^5.11.2",
"colors": "1.1.2",
"core-js": "^1.2.6",
"del": "2.2.0",
"es6-transpiler": "0.7.18",
"eslint": "^1.10.3",
Expand Down
3 changes: 0 additions & 3 deletions resources/jest.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,5 @@ interface MockFunction {
declare module 'jasmine-check' {
export function install(global?: any): void;
}
declare module 'core-js/library' {
export function Symbol(global?: any): any;
}
declare var check: any;
declare var gen: any;

0 comments on commit 1269d45

Please sign in to comment.