From c3cdaeab6505e87c20c692cc08bcd2caf7664e31 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Fri, 28 Jul 2017 11:48:17 -0400 Subject: [PATCH] test: Run input tests Fixes #817 --- __tests__/__snapshots__/test.js.snap | 1325 ++++++++++++++++++++++++++ __tests__/test.js | 10 +- 2 files changed, 1330 insertions(+), 5 deletions(-) diff --git a/__tests__/__snapshots__/test.js.snap b/__tests__/__snapshots__/test.js.snap index 4c60f81..d3bf51b 100644 --- a/__tests__/__snapshots__/test.js.snap +++ b/__tests__/__snapshots__/test.js.snap @@ -743,6 +743,1331 @@ Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refer " `; +exports[`html nested.input.js 1`] = ` +" + + + + documentation 5.0.1 | Documentation + + + + + + +
+
+
+
+

documentation

+
5.0.1
+ +
+ +
+ +
+
+
+ + +
+ + +
+ +

+ Klass +

+ + +
+ + +

Creates a new Klass

+ + +
new Klass(foo: any)
+ + +

+ Extends + + Stream.Writable + +

+ + + + + + + + + + +
Parameters
+
+ +
+
+ foo (any) + +
+ +
+ +
+ + + + + + + + + + + +
Static Members
+
+ +
+
+
+ + isClass(other, also) +
+
+
+
+ + + +

Decide whether an object is a Klass instance +This is a [klasssic]Klass +This is a [link to something that does not exist]DoesNot

+ + +
isClass(other: Object, also: any): boolean
+ + + + + + + + + + + +
Parameters
+
+ +
+
+ other (Object) + +
+ +
+ +
+
+ also (any) + +
+ +
+ +
+ + + + + + +
Returns
+ boolean: + whether the other thing is a Klass + + + + + + + + + + + + + + +
+ +
+
+ +
+
+
+ + isWeird(other) +
+
+
+
+ + + +

A function that triggers the case where the autolinker doesn't find +the referenced class type

+ + +
isWeird(other: Weird): boolean
+ + + + + + + + + + + +
Parameters
+
+ +
+
+ other (Weird) + +
+ +
+ +
+ + + + + + +
Returns
+ boolean: + whether the other thing is a Klass + + + + + + + + + + + + + + +
+ +
+
+ +
+
+
+ + isBuffer(buf, size) +
+
+
+
+ + + +

This method takes a Buffer object that will be linked to nodejs.org

+ + +
isBuffer(buf: (Buffer | string), size: number): boolean
+ + + + + + + + + + + +
Parameters
+
+ +
+
+ buf ((Buffer | string)) + +
+ +
+ +
+
+ size (number + = 0) + size + +
+ +
+ +
+ + + + + + +
Returns
+ boolean: + whether the other thing is a Klass + + + + + + + + + + + + + + +
+ +
+
+ +
+
+
+ + isArrayOfBuffers(buffers) +
+
+
+
+ + + +

This method takes an array of buffers and counts them

+ + +
isArrayOfBuffers(buffers: Array<Buffer>): number
+ + + + + + + + + + + +
Parameters
+
+ +
+
+ buffers (Array<Buffer>) + some buffers + +
+ +
+ +
+ + + + + + +
Returns
+ number: + how many + + + + + + + + +
Example
+ + +
var k = new Klass();
+k.isArrayOfBuffers();
+ + + + + + + + +
+ +
+
+ +
+
+
+ + MAGIC_NUMBER +
+
+
+
+ + + +

A magic number that identifies this Klass.

+ + +
MAGIC_NUMBER
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + +
Instance Members
+
+ +
+
+
+ + getFoo() +
+
+
+
+ + + +

Get this Klass's foo

+ + +
getFoo(): Number
+ + + + + + + + + + + + + + + + +
Returns
+ Number: + foo + + + + + + + + +
Example
+ +

this shows you how to getFoo

+

+
var x = foo.getFoo();
+ + + + + + + + +
+ +
+
+ +
+
+
+ + withOptions(options, otherOptions) +
+
+
+
+ + + +

A function with an options parameter

+ + +
withOptions(options: Object, otherOptions: number?)
+ + + + + + + + + + + +
Parameters
+
+ +
+
+ options (Object) + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
options.foo string +
options.bar number +
+ +
+ +
+
+ otherOptions (number?) + +
+ +
+ +
+ + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + +
Events
+
+ +
+
+
+ + event +
+
+
+
+ + + +

Klass event

+ + +
event
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + +
+ + + + +
+ + +
+ +

+ CustomError +

+ + +
+ + +

a typedef with nested properties

+ + +
CustomError(other: any, also: any)
+ + + + + + + + + + + +
Parameters
+
+ +
+
+ other (any) + +
+ +
+ +
+
+ also (any) + +
+ +
+ +
+ + + +
Properties
+
+ +
+ error (object) + : An error + + +
    + +
  • error.code string + +

    The error's code

    +
  • + +
  • error.description string + +

    The error's description

    +
  • + +
+ +
+ +
+ + + + + + + + + + + + + +
+ + + + +
+ + +
+ +

+ bar +

+ + +
+ + +

Get an instance of Klass. Will make +a klass instance multiword, +like a klass

+ + +
bar(): Klass
+ + + + + + + + + + + + + + + + +
Returns
+ Klass: + that class + + + + + + + + + + + + + + +
+ + + + +
+ + +
+ +

+ bar +

+ + +
+ + +

Rest property function

+ + +
bar(toys: ...Number): undefined
+ + + + + + + + + + + +
Parameters
+
+ +
+
+ toys (...Number) + +
+ +
+ +
+ + + + + + +
Returns
+ undefined: + nothing + + + + + + + + + + + + + + +
+ + + + +
+ + +
+ +

+ bar +

+ + +
+ + +

Get an instance of Klass. Will make +a klass instance multiword, +like a klass. This needs a number input.

+ + +
bar(): undefined
+ + + + + + + + + + + + + + + + +
Returns
+ undefined: + nothing + + + + + + + + + + + + + + +
+ + + + +
+ + +
+ +

+ Foo +

+ + +
+ + +

This is Foo

+ + +
new Foo()
+ + + + + + + + + + + + + + + + + + + + + + + +
Instance Members
+
+ +
+
+
+ + bar +
+
+
+
+ + + +

This is bar

+ + +
bar
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + +
+ + + + +
+ + +
+ +

+ customStreams +

+ + +
+ + +

I am the container of stream types

+ + +
customStreams
+ + + + + + + + + + + + + + + + + + + + + +
Static Members
+
+ +
+
+
+ + new passthrough() +
+
+
+
+ + + +

I am a passthrough stream that belongs to customStreams

+ + +
new passthrough()
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + +
+ + + +
+
+
+ + + + +" +`; + exports[`multi-file input 1`] = ` Array [ Object { diff --git a/__tests__/test.js b/__tests__/test.js index 2da4855..03afdb9 100644 --- a/__tests__/test.js +++ b/__tests__/test.js @@ -89,7 +89,7 @@ test('bad input', function() { }); }); -test('html', function() { +describe('html', function() { glob .sync(path.join(__dirname, 'fixture/html', '*.input.js')) .forEach(function(file) { @@ -109,7 +109,7 @@ test('html', function() { }); }); -test('outputs', function() { +describe('outputs', function() { glob .sync(path.join(__dirname, 'fixture', '*.input.js')) .forEach(function(file) { @@ -157,9 +157,9 @@ test('outputs', function() { test('highlightAuto md output', async function() { var file = path.join( - __dirname, - 'fixture/auto_lang_hljs/multilanguage.input.js' - ), + __dirname, + 'fixture/auto_lang_hljs/multilanguage.input.js' + ), hljsConfig = { hljs: { highlightAuto: true, languages: ['js', 'css', 'html'] } };