Skip to content

Commit

Permalink
test(typedoc): Add test for typedoc 0.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherthielen committed Jan 9, 2019
1 parent 02b6c4e commit b15b45c
Show file tree
Hide file tree
Showing 11 changed files with 134 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/typedoc-0.13.0/cypress.json
@@ -0,0 +1,4 @@
{
"baseUrl": "http://localhost:4000",
"video": false
}
75 changes: 75 additions & 0 deletions test/typedoc-0.13.0/cypress/integration/example_spec.js
@@ -0,0 +1,75 @@
describe('docs', () => {
it('loads', () => {
cy.visit('');
});

it('renders dir1 external', () => {
cy.visit('/');
let ul = cy.get('nav.tsd-navigation.primary ul');
ul.get('li.tsd-kind-external-module.tsd-is-external.tsd-is-external').contains('dir1');
});

it('renders dir2 external', () => {
cy.visit('/');
let ul = cy.get('nav.tsd-navigation.primary ul');
ul.get('li.tsd-kind-external-module.tsd-is-external.tsd-is-external').contains('dir2');
});

it('renders root external', () => {
cy.visit('/');
let ul = cy.get('nav.tsd-navigation.primary ul');
ul.get('li.tsd-kind-external-module.tsd-is-external.tsd-is-external').contains('root');
});

it('renders File1 and File2 in root', () => {
cy.visit('/');

let ul = cy
.get('nav.tsd-navigation.primary ul')
.get('li a')
.contains('root')
.click();

cy.contains('External module root');

cy.get('ul.tsd-index-list')
.get('a')
.contains('File1');

cy.get('ul.tsd-index-list')
.get('a')
.contains('File2');
});

it('renders Nest1 in dir1', () => {
cy.visit('/');

let ul = cy
.get('nav.tsd-navigation.primary ul')
.get('li a')
.contains('dir1')
.click();

cy.contains('External module dir1');

cy.get('ul.tsd-index-list')
.get('a')
.contains('Nest1');
});

it('renders Nest2 in dir2', () => {
cy.visit('/');

let ul = cy
.get('nav.tsd-navigation.primary ul')
.get('li a')
.contains('dir2')
.click();

cy.contains('External module dir2');

cy.get('ul.tsd-index-list')
.get('a')
.contains('Nest2');
});
});
18 changes: 18 additions & 0 deletions test/typedoc-0.13.0/package.json
@@ -0,0 +1,18 @@
{
"name": "external-module-name-typedoc-0.13.0",
"version": "1.0.0",
"description": "Test against typedoc 0.13.0",
"main": "index.js",
"scripts": {
"build": "typedoc --out dist src/index.ts",
"test": "npm run build && npm run e2e",
"e2e": "cypress-runner run --nospa --path dist"
},
"author": "Chris Thielen",
"license": "MIT",
"devDependencies": {
"@uirouter/cypress-runner": "latest",
"typedoc": "0.13.0",
"typedoc-plugin-external-module-name": "latest"
}
}
2 changes: 2 additions & 0 deletions test/typedoc-0.13.0/src/dir1/index.ts
@@ -0,0 +1,2 @@
/** @module dir1 */
export * from './nest1';
2 changes: 2 additions & 0 deletions test/typedoc-0.13.0/src/dir1/nest1.ts
@@ -0,0 +1,2 @@
/** @module dir1 */ /** */
export class Nest1 {}
2 changes: 2 additions & 0 deletions test/typedoc-0.13.0/src/dir2/index.ts
@@ -0,0 +1,2 @@
/** @module dir2 */
export * from './nest2';
2 changes: 2 additions & 0 deletions test/typedoc-0.13.0/src/dir2/nest2.ts
@@ -0,0 +1,2 @@
/** @module dir2 */
export class Nest2 {}
7 changes: 7 additions & 0 deletions test/typedoc-0.13.0/src/file1.ts
@@ -0,0 +1,7 @@
/**
* @module root
*/
/** for typedoc */

/** This is in the root module */
export class File1 {}
3 changes: 3 additions & 0 deletions test/typedoc-0.13.0/src/file2.ts
@@ -0,0 +1,3 @@
/** @module root */
/** This is also in the root module */
export class File2 {}
6 changes: 6 additions & 0 deletions test/typedoc-0.13.0/src/index.ts
@@ -0,0 +1,6 @@
/** @module root */

export * from './file1';
export * from './file2';
export * from './dir1';
export * from './dir2';
13 changes: 13 additions & 0 deletions test/typedoc-0.13.0/tsconfig.json
@@ -0,0 +1,13 @@
{
"compilerOptions": {
"moduleResolution": "node",
"module": "commonjs",
"lib": ["es6", "dom"],
"noImplicitAny": true,
"skipLibCheck": true,
"noEmit": true,
"target": "es5",
"typeRoots": ["typings"]
},
"files": ["src/index.ts"]
}

0 comments on commit b15b45c

Please sign in to comment.