Permalink
Browse files

Add test for issue#3

  • Loading branch information...
1 parent 364c39b commit a3aa933a80e1067317d4d5ffa5cbb6c541df2f91 @chick307 committed Mar 14, 2013
Showing with 29 additions and 1 deletion.
  1. +1 −1 Gruntfile.coffee
  2. +10 −0 test/base64codec-test.js
  3. +18 −0 test/issue-3.html
View
@@ -8,7 +8,7 @@ module.exports = (grunt) ->
mocha:
all:
- src: ['test/index.html']
+ src: ['test/index.html', 'test/issue-3.html']
options:
run: true
View
@@ -161,4 +161,14 @@ describe('base64codec', function() {
});
});
});
+
+ describe('issue#3', function() {
+ var base64String = 'cyJ9XX0=';
+ var expected = 's"}]}';
+
+ it('decode(' + JSON.stringify(base64String) + ')', function() {
+ var actual = base64codec.decode(base64String);
+ assert.strictEqual(actual, expected);
+ });
+ });
});
View
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>base64codec test</title>
+ <link rel="stylesheet" href="../node_modules/mocha/mocha.css">
+ <script>window.atob = void 0</script>
+</head>
+<body>
+ <div id="mocha"></div>
+ <script src="../node_modules/mocha/mocha.js"></script>
+ <script>mocha.setup('bdd');</script>
+ <script src="assert.js"></script>
+ <script src="../base64codec.js"></script>
+ <script src="./base64codec-test.js"></script>
+ <script>mocha.run();</script>
+</body>
+</html>

0 comments on commit a3aa933

Please sign in to comment.