-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add tests and make sure exposed JSON doesnt override the real window.…
…JSON object
- Loading branch information
Showing
4 changed files
with
28 additions
and
12 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
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,17 @@ | ||
|
||
describe('JSON', function(){ | ||
var json = require('json-fallback'); | ||
var assert = require('assert'); | ||
|
||
it('should not leak to the global scope', function(){ | ||
assert(json != window.JSON); | ||
}) | ||
|
||
it('should parse json', function(){ | ||
assert(0 == json.parse('[0]')[0]); | ||
}) | ||
|
||
it('should stringify json', function(){ | ||
assert('[0]' == json.stringify([0])); | ||
}) | ||
}) |