Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(372)

Side by Side Diff: sky/tests/modules/modules.sky

Issue 872043003: module.exports should default to an empty object. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/tests/modules/import-without-export.sky ('k') | sky/tests/modules/modules-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <html>
2 <import src="../resources/chai.sky" /> 2 <import src="../resources/chai.sky" />
3 <import src="../resources/mocha.sky" /> 3 <import src="../resources/mocha.sky" />
4 <script> 4 <script>
5 describe('Module', function() { 5 describe('Module', function() {
6 it('should be constructable', function() { 6 it('should be constructable', function() {
7 var doc1 = new Document(); 7 var doc1 = new Document();
8 var app = new Application(doc1, "http://www.example.com/app"); 8 var app = new Application(doc1, "http://www.example.com/app");
9 9
10 var doc2 = new Document(); 10 var doc2 = new Document();
11 var module = new Module(app, doc2, "http://www.example.com/module"); 11 var module = new Module(app, doc2, "http://www.example.com/module");
12 assert.equal(module.application, app); 12 assert.equal(module.application, app);
13 assert.equal(module.document, doc2); 13 assert.equal(module.document, doc2);
14 assert.equal(module.url, "http://www.example.com/module"); 14 assert.equal(module.url, "http://www.example.com/module");
15 }); 15 });
16
17 it('should have an empty object by default for exports', function() {
18 var app = new Application(new Document(), "http://www.example.com/app");
19 var module = new Module(app, new Document(), "http://www.example.com/module" );
20 assert.isObject(module.exports);
21 assert.lengthOf(Object.keys(module.exports), 0);
22 });
16 }); 23 });
17 </script> 24 </script>
18 </html> 25 </html>
OLDNEW
« no previous file with comments | « sky/tests/modules/import-without-export.sky ('k') | sky/tests/modules/modules-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698