This PR introduces an initial setup for unit testing to help validate fixes more quickly, without the need for a full NetBeans environment and VS Code UI runs. This setup includes sample unit tests for JDKDownloaderView in view.ts and adds few development dependencies for testing and mocking. A few VS Code-related mocks are also included.
List of DevDependencies added and Justification:
@istanbuljs/nyc-config-typescript:
A code coverage tool, with TypeScript support, ensuring code coverage reporting for TypeScript code.
@types/chai & chai: chai is a popular assertion library used for writing readable and expressive test assertions. @types/chai provides TypeScript definitions for chai.
@types/sinon & sinon: sinon is a library for creating mocks, spies, and stubs, useful for isolating and testing code components. @types/sinon provides TypeScript definitions.
ts-mockito:
Provides a simpler API for creating mocks in TypeScript, offering an alternative to sinon for creating clean, readable mocks in TypeScript. Sinon doesn't have support for mocking interfaces and namesapce. So, it is also required.
vscode-uri:
Used for handling and manipulating URIs in a way consistent with VS Code’s own URI utilities, especially useful for file and path manipulations within tests.
This PR introduces an initial setup for unit testing to help validate fixes more quickly, without the need for a full NetBeans environment and VS Code UI runs. This setup includes sample unit tests for
JDKDownloaderView
inview.ts
and adds few development dependencies for testing and mocking. A few VS Code-related mocks are also included.List of DevDependencies added and Justification:
@istanbuljs/nyc-config-typescript
:A code coverage tool, with TypeScript support, ensuring code coverage reporting for TypeScript code.
@types/chai
&chai
:chai
is a popular assertion library used for writing readable and expressive test assertions.@types/chai
provides TypeScript definitions forchai
.@types/sinon
&sinon
:sinon
is a library for creating mocks, spies, and stubs, useful for isolating and testing code components.@types/sinon
provides TypeScript definitions.ts-mockito
:Provides a simpler API for creating mocks in TypeScript, offering an alternative to
sinon
for creating clean, readable mocks in TypeScript. Sinon doesn't have support for mocking interfaces and namesapce. So, it is also required.vscode-uri
:Used for handling and manipulating URIs in a way consistent with VS Code’s own URI utilities, especially useful for file and path manipulations within tests.