[Pkg-javascript-commits] [node-umd] 02/07: Provides tests for the new feature and wraps name in quotes.
Bastien Roucariès
rouca at moszumanska.debian.org
Mon Apr 17 07:38:09 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to annotated tag 2.0.0
in repository node-umd.
commit 4cff9b71a598d027c08ce3c320b28e198c4e0545
Author: Quildreen "Sorella" Motta <quildreen at gmail.com>
Date: Wed Nov 27 13:21:49 2013 -0200
Provides tests for the new feature and wraps name in quotes.
---
template.js | 6 +++---
test/index.js | 8 +++++++-
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/template.js b/template.js
index b554ee4..41b2e8d 100644
--- a/template.js
+++ b/template.js
@@ -10,11 +10,11 @@
// <script>
} else {
if (typeof window !== "undefined") {
- setup(window, {{name}}, f())
+ setup(window, "{{name}}", f())
} else if (typeof global !== "undefined") {
- setup(global, {{name}}, f())
+ setup(global, "{{name}}", f())
} else if (typeof self !== "undefined") {
- setup(self, {{name}}, f())
+ setup(self, "{{name}}", f())
}
}
diff --git a/test/index.js b/test/index.js
index 3e2d943..ca0e0bc 100644
--- a/test/index.js
+++ b/test/index.js
@@ -1,6 +1,7 @@
var assert = require('assert')
var umd = require('../')
var src = umd('sentinel-prime', 'return "sentinel"')
+var namespacedSrc = umd('sentinel.prime', 'return "sentinel"')
describe('with CommonJS', function () {
it('uses module.exports', function () {
@@ -36,4 +37,9 @@ describe('in the absense of a module system', function () {
Function('self,window,global', src)(glob)
assert(glob.sentinelPrime === 'sentinel')
})
-})
\ No newline at end of file
+ it('creates the proper namespaces', function() {
+ var glob = {}
+ Function('window', namespacedSrc)(glob)
+ assert(glob.sentinel.prime === 'sentinel')
+ })
+})
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-umd.git
More information about the Pkg-javascript-commits
mailing list