Skip to content

Commit

Permalink
chore: add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
wemeetagain committed Dec 14, 2023
1 parent aec8dfb commit 254f830
Show file tree
Hide file tree
Showing 25 changed files with 391 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/fixtures/projects/a-large-monorepo/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "a-large-monorepo",
"version": "1.0.0",
"description": "",
"homepage": "https://github.com/ipfs/aegir#readme",
"scripts": {
"docs": "aegir docs"
},
"workspaces": [
"packages/*"
]
}
17 changes: 17 additions & 0 deletions test/fixtures/projects/a-large-monorepo/packages/a/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "a",
"version": "1.0.0",
"description": "",
"homepage": "https://github.com/ipfs/aegir#readme",
"exports": {
".": {
"import": "./src/index.js"
}
},
"scripts": {
"test": "echo very test"
},
"type": "module",
"author": "",
"license": "ISC"
}
16 changes: 16 additions & 0 deletions test/fixtures/projects/a-large-monorepo/packages/a/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* @typedef {import('./types').ExportedButNotInExports} ExportedButNotInExports
*/

/**
* @typedef {object} AnExportedInterface
* @property {() => void} AnExportedInterface.aMethod
*/

export const useHerp = () => {

}

export const useDerp = () => {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export interface ExportedButNotInExports {
aMethod(): void
}
39 changes: 39 additions & 0 deletions test/fixtures/projects/a-large-monorepo/packages/a/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"compilerOptions": {
"strict": true,
// project options
"outDir": "dist",
"allowJs": true,
"checkJs": true,
"target": "ES2020",
"module": "ES2020",
"lib": ["ES2021", "ES2021.Promise", "ES2021.String", "ES2020.BigInt", "DOM", "DOM.Iterable"],
"noEmit": false,
"noEmitOnError": true,
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true,
"incremental": true,
"composite": true,
"isolatedModules": true,
"removeComments": false,
"sourceMap": true,
// module resolution
"esModuleInterop": true,
"moduleResolution": "node",
// linter checks
"noImplicitReturns": false,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": false,
// advanced
"verbatimModuleSyntax": true,
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true,
"stripInternal": true,
"resolveJsonModule": true
},
"include": [
"src"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"entryPoints": ["./src/index.js"]
}
20 changes: 20 additions & 0 deletions test/fixtures/projects/a-large-monorepo/packages/b/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "b",
"version": "1.0.0",
"description": "",
"homepage": "https://github.com/ipfs/aegir#readme",
"exports": {
".": {
"import": "./src/index.js"
}
},
"dependencies": {
"a": "1.0.0"
},
"scripts": {
"test": "echo very test"
},
"type": "module",
"author": "",
"license": "ISC"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* @param {string} arg
* @returns {boolean}
*/
export function garply (arg) {
return true
}
18 changes: 18 additions & 0 deletions test/fixtures/projects/a-large-monorepo/packages/b/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* @typedef {import('./types.js').ExportedButNotInExports} ExportedButNotInExports
*/

/**
* @typedef {object} AnExportedInterface
* @property {() => void} AnExportedInterface.aMethod
*/

export const useHerp = () => {

}

export const useDerp = () => {

}

export { garply } from './dir/index.js'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export interface ExportedButNotInExports {
aMethod(): void
}
39 changes: 39 additions & 0 deletions test/fixtures/projects/a-large-monorepo/packages/b/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"compilerOptions": {
"strict": true,
// project options
"outDir": "dist",
"allowJs": true,
"checkJs": true,
"target": "ES2020",
"module": "ES2020",
"lib": ["ES2021", "ES2021.Promise", "ES2021.String", "ES2020.BigInt", "DOM", "DOM.Iterable"],
"noEmit": false,
"noEmitOnError": true,
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true,
"incremental": true,
"composite": true,
"isolatedModules": true,
"removeComments": false,
"sourceMap": true,
// module resolution
"esModuleInterop": true,
"moduleResolution": "node",
// linter checks
"noImplicitReturns": false,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": false,
// advanced
"verbatimModuleSyntax": true,
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true,
"stripInternal": true,
"resolveJsonModule": true
},
"include": [
"src"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"entryPoints": ["./src/index.js"]
}
20 changes: 20 additions & 0 deletions test/fixtures/projects/a-large-monorepo/packages/c/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "c",
"version": "1.0.0",
"description": "",
"homepage": "https://github.com/ipfs/aegir#readme",
"exports": {
".": {
"import": "./src/index.js"
}
},
"dependencies": {
"a": "1.0.0"
},
"scripts": {
"test": "echo very test"
},
"type": "module",
"author": "",
"license": "ISC"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* @param {string} arg
* @returns {boolean}
*/
export function garply (arg) {
return true
}
18 changes: 18 additions & 0 deletions test/fixtures/projects/a-large-monorepo/packages/c/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* @typedef {import('./types.js').ExportedButNotInExports} ExportedButNotInExports
*/

/**
* @typedef {object} AnExportedInterface
* @property {() => void} AnExportedInterface.aMethod
*/

export const useHerp = () => {

}

export const useDerp = () => {

}

export { garply } from './dir/index.js'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export interface ExportedButNotInExports {
aMethod(): void
}
39 changes: 39 additions & 0 deletions test/fixtures/projects/a-large-monorepo/packages/c/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"compilerOptions": {
"strict": true,
// project options
"outDir": "dist",
"allowJs": true,
"checkJs": true,
"target": "ES2020",
"module": "ES2020",
"lib": ["ES2021", "ES2021.Promise", "ES2021.String", "ES2020.BigInt", "DOM", "DOM.Iterable"],
"noEmit": false,
"noEmitOnError": true,
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true,
"incremental": true,
"composite": true,
"isolatedModules": true,
"removeComments": false,
"sourceMap": true,
// module resolution
"esModuleInterop": true,
"moduleResolution": "node",
// linter checks
"noImplicitReturns": false,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": false,
// advanced
"verbatimModuleSyntax": true,
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true,
"stripInternal": true,
"resolveJsonModule": true
},
"include": [
"src"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"entryPoints": ["./src/index.js"]
}
20 changes: 20 additions & 0 deletions test/fixtures/projects/a-large-monorepo/packages/d/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "d",
"version": "1.0.0",
"description": "",
"homepage": "https://github.com/ipfs/aegir#readme",
"exports": {
".": {
"import": "./src/index.js"
}
},
"dependencies": {
"c": "1.0.0"
},
"scripts": {
"test": "echo very test"
},
"type": "module",
"author": "",
"license": "ISC"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* @param {string} arg
* @returns {boolean}
*/
export function garply (arg) {
return true
}
18 changes: 18 additions & 0 deletions test/fixtures/projects/a-large-monorepo/packages/d/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* @typedef {import('./types.js').ExportedButNotInExports} ExportedButNotInExports
*/

/**
* @typedef {object} AnExportedInterface
* @property {() => void} AnExportedInterface.aMethod
*/

export const useHerp = () => {

}

export const useDerp = () => {

}

export { garply } from './dir/index.js'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export interface ExportedButNotInExports {
aMethod(): void
}
39 changes: 39 additions & 0 deletions test/fixtures/projects/a-large-monorepo/packages/d/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"compilerOptions": {
"strict": true,
// project options
"outDir": "dist",
"allowJs": true,
"checkJs": true,
"target": "ES2020",
"module": "ES2020",
"lib": ["ES2021", "ES2021.Promise", "ES2021.String", "ES2020.BigInt", "DOM", "DOM.Iterable"],
"noEmit": false,
"noEmitOnError": true,
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true,
"incremental": true,
"composite": true,
"isolatedModules": true,
"removeComments": false,
"sourceMap": true,
// module resolution
"esModuleInterop": true,
"moduleResolution": "node",
// linter checks
"noImplicitReturns": false,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": false,
// advanced
"verbatimModuleSyntax": true,
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true,
"stripInternal": true,
"resolveJsonModule": true
},
"include": [
"src"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"entryPoints": ["./src/index.js"]
}
Loading

0 comments on commit 254f830

Please sign in to comment.