diff --git a/test/scanner/client.test.ts b/test/scanner/client.test.ts new file mode 100644 index 0000000..3a4ca58 --- /dev/null +++ b/test/scanner/client.test.ts @@ -0,0 +1,44 @@ + +import { + // assert, + expect, + test +} from 'vitest' + +import { createApp } from 'vue' + + +import AppFilesScanner from '~/helpers/app-files-scanner.js' + +// import { +// isString +// } from '~/helpers/check-types.js' + +// const cases = [ + +// ] + + +function buildVueInstance () { + return createApp({ + template: '
Hello World
', + data: function () { + return { + appsBeingScanned: [] + } + }, + }) +} + +test('Can initialize AppFilesScanner within Vite context', async () => { + const vueInstance:any = buildVueInstance() + + const scanner = new AppFilesScanner({ + observableFilesArray: vueInstance.appsBeingScanned, + testResultStore: global.$config.testResultStore + }) + + // Expect the scanner to be an instance of AppFilesScanner + expect( scanner ).toBeInstanceOf( AppFilesScanner ) + +})