Skip to content
Browse files

Validation test, Travis

  • Loading branch information...
1 parent 2ff83d4 commit 11230d1015cf2a3ad44ebf11a781c341f1a3f449 Daniel Wirtz committed
Showing with 79 additions and 3 deletions.
  1. +5 −0 .travis.yml
  2. +4 −1 assert.js
  3. +10 −0 contrib/ByteBuffer.js
  4. +4 −2 contrib/Express.js
  5. 0 node.js → core.js
  6. +23 −0 package.json
  7. +5 −0 stream.js
  8. +28 −0 tests/validate.js
View
5 .travis.yml
@@ -0,0 +1,5 @@
+language: node_js
+node_js:
+ - 0.6
+ - 0.8
+ - 0.9
View
5 assert.js
@@ -112,12 +112,15 @@ assert.strictEqual = function(actual, expected, message) {};
assert.notStrictEqual = function(actual, expected, message) {};
/**
+ * @name assert.throws
+ * @function
* @param {function} block
* @param {Function|RegExp|function(*)} error
* @param {string=} message
* @throws {assert.AssertionError}
*/
-assert.throws = function(block, error, message) {};
+// Error: .\assert.js:120: ERROR - Parse error. missing name after . operator
+// assert.throws = function(block, error, message) {};
/**
* @param {function} block
View
10 contrib/ByteBuffer.js
@@ -90,6 +90,16 @@ ByteBuffer.allocate = function(capacity, littleEndian) {};
ByteBuffer.wrap = function(buffer, littleEndian) {};
/**
+ * @return {ByteBuffer}
+ */
+ByteBuffer.prototype.LE = function() {};
+
+/**
+ * @return {ByteBuffer}
+ */
+ByteBuffer.prototype.BE = function() {};
+
+/**
* @param {number} capacity
* @return {boolean}
*/
View
6 contrib/Express.js
@@ -57,10 +57,12 @@ express.Router = function() {};
express.errorHandler = function() {};
/**
- * @type {function}
+ * @name express.static
+ * @function
* @return {*}
*/
-express["static"] = function() {};
+// Error: .\contrib\Express.js:63: ERROR - Parse error. missing name after . operator
+// express.static = function() {};
/**
* @type {string}
View
0 node.js → core.js
File renamed without changes.
View
23 package.json
@@ -0,0 +1,23 @@
+{
+ "name": "node.js-closure-compiler-externs",
+ "version": "1.0.0",
+ "author": "Daniel Wirtz <dcode@dcode.io>",
+ "description": "A collection of node.js externs for use with Closure Compiler.",
+ "contributors": [
+ { "name": "Daniel Wirtz", "email": "dcode@dcode.io" }
+ ],
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/dcodeIO/node.js-closure-compiler-externs.git"
+ },
+ "devDependencies": {
+ "closurecompiler": ">=1.0.2"
+ },
+ "license": "Apache License, Version 2.0",
+ "engines": {
+ "node": ">=0.6"
+ },
+ "scripts": {
+ "test": "node tests/validate.js"
+ }
+}
View
5 stream.js
@@ -29,6 +29,11 @@
*/
/**
+ * @type {Object.<string,*>}
+ */
+var stream = {};
+
+/**
* @constructor
* @extends events.EventEmitter
*/
View
28 tests/validate.js
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2012 The Closure Compiler Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Validate Script: Tries to validate the existing externs by including them in a compile step.
+ */
+
+var ClosureCompiler = require("closurecompiler");
+
+ClosureCompiler.compile(__filename, {compilation_level: "ADVANCED_OPTIMIZATIONS", "externs": [".", "./contrib"]}, function(error, result) {
+ if (error) {
+ throw(error);
+ }
+ console.log("✔ All externs validate");
+});

0 comments on commit 11230d1

Please sign in to comment.
Something went wrong with that request. Please try again.