Skip to content

Commit

Permalink
Adding ES6 module tests equivalent to goog.module tests in CheckJSDoc…
Browse files Browse the repository at this point in the history
…StyleTest of the LINTCHECKS pass. Part of verification/adding of ES6 module compatibility to compiler.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160205724
  • Loading branch information
hjkaria authored and brad4d committed Jun 27, 2017
1 parent 59bc852 commit 0aa33df
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/com/google/javascript/jscomp/lint/CheckJSDocStyleTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -363,11 +363,31 @@ public void testMissingJsDoc_googModule() {
testWarning("goog.module('a.b.c'); var f = function() {};", MISSING_JSDOC);
}

public void testMissingJsDoc_ES6Module01() {
testWarning("export default abc; function f() {}", MISSING_JSDOC);
}

public void testMissingJsDoc_ES6Module02() {
testWarning("export default abc; var f = function() {};", MISSING_JSDOC);
}

public void testMissingJsDoc_ES6Module03() {
testWarning("export function f() {};", MISSING_JSDOC);
}

public void testMissingJsDoc_googModule_noWarning() {
testSame("goog.module('a.b.c'); /** @type {function()} */ function f() {}");
testSame("goog.module('a.b.c'); /** @type {function()} */ var f = function() {};");
}

public void testMissingJsDoc_ES6Module_noWarning01() {
testSame("export default abc; /** @type {function()} */ function f() {}");
}

public void testMissingJsDoc_ES6Module_noWarning02() {
testSame("export default abc; /** @type {function()} */ var f = function() {};");
}

private static String inIIFE(String js) {
return "(function() {\n" + js + "\n})()";
}
Expand Down

0 comments on commit 0aa33df

Please sign in to comment.