-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
- Loading branch information
1 parent
def90ca
commit ea9bb62
Showing
7 changed files
with
241 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
/** | ||
* @file Test Baselines - LIB | ||
* @module tests/baselines/LIB | ||
*/ | ||
|
||
export default [ | ||
'decorators.legacy', | ||
'decorators', | ||
'dom.iterable', | ||
'dom', | ||
'es5', | ||
'es6', | ||
'es7', | ||
'es2015.collection', | ||
'es2015.core', | ||
'es2015.generator', | ||
'es2015.iterable', | ||
'es2015.promise', | ||
'es2015.proxy', | ||
'es2015.reflect', | ||
'es2015.symbol.wellknown', | ||
'es2015.symbol', | ||
'es2015', | ||
'es2016.array.include', | ||
'es2016.full', | ||
'es2016', | ||
'es2017.full', | ||
'es2017.intl', | ||
'es2017.object', | ||
'es2017.sharedmemory', | ||
'es2017.string', | ||
'es2017.typedarrays', | ||
'es2017', | ||
'es2018.asyncgenerator', | ||
'es2018.asynciterable', | ||
'es2018.full', | ||
'es2018.intl', | ||
'es2018.promise', | ||
'es2018.regexp', | ||
'es2018', | ||
'es2019.array', | ||
'es2019.full', | ||
'es2019.intl', | ||
'es2019.object', | ||
'es2019.string', | ||
'es2019.symbol', | ||
'es2019', | ||
'es2020.bigint', | ||
'es2020.date', | ||
'es2020.full', | ||
'es2020.intl', | ||
'es2020.number', | ||
'es2020.promise', | ||
'es2020.sharedmemory', | ||
'es2020.string', | ||
'es2020.symbol.wellknown', | ||
'es2020', | ||
'es2021.full', | ||
'es2021.intl', | ||
'es2021.promise', | ||
'es2021.string', | ||
'es2021.weakref', | ||
'es2021', | ||
'es2022.array', | ||
'es2022.error', | ||
'es2022.full', | ||
'es2022.intl', | ||
'es2022.object', | ||
'es2022.regexp', | ||
'es2022.sharedmemory', | ||
'es2022.string', | ||
'es2022', | ||
'es2023.array', | ||
'es2023.full', | ||
'es2023', | ||
'esnext.array', | ||
'esnext.asynciterable', | ||
'esnext.bigint', | ||
'esnext.full', | ||
'esnext.intl', | ||
'esnext.promise', | ||
'esnext.string', | ||
'esnext.symbol', | ||
'esnext.weakref', | ||
'esnext', | ||
'scripthost', | ||
'webworker.importscripts', | ||
'webworker.iterable', | ||
'webworker' | ||
] as const |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* @file Type Tests - LIB | ||
* @module tsconfig-utils/utils/tests/unit-d/LIB | ||
*/ | ||
|
||
import type { Lib, LibFile } from '@flex-development/tsconfig-types' | ||
import type TEST_SUBJECT from '../lib' | ||
|
||
describe('unit-d:utils/LIB', () => { | ||
it('should equal type of Map<Lowercase<Lib>, LibFile>', () => { | ||
// Arrange | ||
type Expected = Map<Lowercase<Lib>, LibFile> | ||
|
||
// Expect | ||
expectTypeOf<typeof TEST_SUBJECT>().toEqualTypeOf<Expected>() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* @file Unit Tests - LIB | ||
* @module tsconfig-utils/utils/tests/unit/LIB | ||
*/ | ||
|
||
import BASELINE from '#tests/baselines/lib' | ||
import TEST_SUBJECT from '../lib' | ||
|
||
describe('unit:utils/LIB', () => { | ||
it('should be instance of Map', () => { | ||
expect(TEST_SUBJECT).to.be.instanceof(Map) | ||
}) | ||
|
||
it('should contain lib names', () => { | ||
expect([...TEST_SUBJECT.keys()]).to.deep.equal(BASELINE) | ||
}) | ||
|
||
it('should map lib names to lib filenames', () => { | ||
for (const [name, filename] of TEST_SUBJECT.entries()) { | ||
expect(filename).to.equal(`lib.${name}.d.ts`) | ||
} | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
/** | ||
* @file Utilities - LIB | ||
* @module tsconfig-utils/utils/LIB | ||
*/ | ||
|
||
import type { Lib, LibFile } from '@flex-development/tsconfig-types' | ||
|
||
/** | ||
* Maps lowercase [lib names][1] to files in the `node_modules/typescript/lib` | ||
* directory. | ||
* | ||
* [1]: https://www.typescriptlang.org/tsconfig#lib | ||
* | ||
* @const {Map<Lowercase<Lib>, LibFile>} LIB | ||
*/ | ||
const LIB: Map<Lowercase<Lib>, LibFile> = new Map<Lowercase<Lib>, LibFile>( | ||
[ | ||
'decorators.legacy', | ||
'decorators', | ||
'dom.iterable', | ||
'dom', | ||
'es5', | ||
'es6', | ||
'es7', | ||
'es2015.collection', | ||
'es2015.core', | ||
'es2015.generator', | ||
'es2015.iterable', | ||
'es2015.promise', | ||
'es2015.proxy', | ||
'es2015.reflect', | ||
'es2015.symbol.wellknown', | ||
'es2015.symbol', | ||
'es2015', | ||
'es2016.array.include', | ||
'es2016.full', | ||
'es2016', | ||
'es2017.full', | ||
'es2017.intl', | ||
'es2017.object', | ||
'es2017.sharedmemory', | ||
'es2017.string', | ||
'es2017.typedarrays', | ||
'es2017', | ||
'es2018.asyncgenerator', | ||
'es2018.asynciterable', | ||
'es2018.full', | ||
'es2018.intl', | ||
'es2018.promise', | ||
'es2018.regexp', | ||
'es2018', | ||
'es2019.array', | ||
'es2019.full', | ||
'es2019.intl', | ||
'es2019.object', | ||
'es2019.string', | ||
'es2019.symbol', | ||
'es2019', | ||
'es2020.bigint', | ||
'es2020.date', | ||
'es2020.full', | ||
'es2020.intl', | ||
'es2020.number', | ||
'es2020.promise', | ||
'es2020.sharedmemory', | ||
'es2020.string', | ||
'es2020.symbol.wellknown', | ||
'es2020', | ||
'es2021.full', | ||
'es2021.intl', | ||
'es2021.promise', | ||
'es2021.string', | ||
'es2021.weakref', | ||
'es2021', | ||
'es2022.array', | ||
'es2022.error', | ||
'es2022.full', | ||
'es2022.intl', | ||
'es2022.object', | ||
'es2022.regexp', | ||
'es2022.sharedmemory', | ||
'es2022.string', | ||
'es2022', | ||
'es2023.array', | ||
'es2023.full', | ||
'es2023', | ||
'esnext.array', | ||
'esnext.asynciterable', | ||
'esnext.bigint', | ||
'esnext.full', | ||
'esnext.intl', | ||
'esnext.promise', | ||
'esnext.string', | ||
'esnext.symbol', | ||
'esnext.weakref', | ||
'esnext', | ||
'scripthost', | ||
'webworker.importscripts', | ||
'webworker.iterable', | ||
'webworker' | ||
].map(name => [name, `lib.${name}.d.ts`] as [Lowercase<Lib>, LibFile]) | ||
) | ||
|
||
export default LIB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters