Skip to content

Chore/add testing infrastructure#25

Open
DanieleCremoniniOwkin wants to merge 8 commits intoZenWave360:masterfrom
DanieleCremoniniOwkin:chore/add-testing-infrastructure
Open

Chore/add testing infrastructure#25
DanieleCremoniniOwkin wants to merge 8 commits intoZenWave360:masterfrom
DanieleCremoniniOwkin:chore/add-testing-infrastructure

Conversation

@DanieleCremoniniOwkin
Copy link

Add testing infrastructure to the project

The project doesn't contain any test infrastructure, which prevents safe refactoring, is needed for bug fixing and is helpful for new developments.

I created the needed infrastructure.
One fake test is included.

To run the tests:
npm run test
from the project root directory.

A caveat: compiling with
npm run compile
gives some 12 errors such as:

  Overload 1 of 2, '(debugType: string, factory: DebugAdapterDescriptorFactory): Disposable', gave the following error.
    Argument of type 'ProviderDebugAdapter' is not assignable to parameter of type 'DebugAdapterDescriptorFactory'.
      The types returned by 'createDebugAdapterDescriptor(...)' are incompatible between these types.
        Type 'Promise<ProviderResult<DebugAdapterDescriptor>>' is not assignable to type 'ProviderResult<DebugAdapterDescriptor>'.
          Type 'Promise<ProviderResult<DebugAdapterDescriptor>>' is not assignable to type 'Thenable<DebugAdapterDescriptor>'.
            Types of property 'then' are incompatible.
              Type '<TResult1 = ProviderResult<DebugAdapterDescriptor>, TResult2 = never>(onfulfilled?: (value: ProviderResult<DebugAdapterDescriptor>) => TResult1 | PromiseLike<...>, onrejected?: (reason: any) => TResult2 | PromiseLike<...>) => Promise<...>' is not assignable to type '{ <TResult>(onfulfilled?: (value: DebugAdapterDescriptor) => TResult | Thenable<TResult>, onrejected?: (reason: any) => TResult | Thenable<...>): Thenable<...>; <TResult>(onfulfilled?: (value: DebugAdapterDescriptor) => TResult | Thenable<...>, onrejected?: (reason: any) => void): Thenable<...>; <TResult>(onfulfille...'.
                Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible.
                  Types of parameters 'value' and 'value' are incompatible.
                    Type 'ProviderResult<DebugAdapterDescriptor>' is not assignable to type 'DebugAdapterDescriptor'.
                      Type 'Thenable<DebugAdapterDescriptor>' is not assignable to type 'DebugAdapterDescriptor'.
  Overload 2 of 2, '(debugType: string, factory: DebugAdapterDescriptorFactory): Disposable', gave the following error.
    Argument of type 'ProviderDebugAdapter' is not assignable to parameter of type 'DebugAdapterDescriptorFactory'.

several instances of:

TS2339: Property 'joinPath' does not exist on type 'typeof Uri'.

this one

TS2416: Property 'createDebugAdapterDescriptor' in type 'ProviderDebugAdapter' is not assignable to the same property in base type 'DebugAdapterDescriptorFactory'.
  Type '(session: DebugSession, executable: DebugAdapterExecutable) => Promise<ProviderResult<DebugAdapterDescriptor>>' is not assignable to type '{ (session: DebugSession, executable: DebugAdapterExecutable): ProviderResult<DebugAdapterDescriptor>; (session: DebugSession, executable: DebugAdapterExecutable): ProviderResult<...>; }'.

and

TS2322: Type '{ command: string; title: string; tooltip: string; }' is not assignable to type 'string'.

which could depend on my environment but I cannot resolve.

@ivangsa
Copy link
Member

ivangsa commented Jun 21, 2023

It looks good.. Do you want to merge this now or when some tests are aded?

@DanieleCremoniniOwkin
Copy link
Author

DanieleCremoniniOwkin commented Jun 22, 2023

I'd prefer now.

Can you please fix the build problems I pasted?

Thank you

@ivangsa
Copy link
Member

ivangsa commented Jun 23, 2023

there is also this error

$ vsce package
 ERROR  You should not depend on 'vscode' in your 'dependencies'. Did you mean to add it to 'devDependencies'?

@ivangsa
Copy link
Member

ivangsa commented Jun 23, 2023

npm run compile runs fine on master... I guess this is caused by the dependencies/versions you added

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants