mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Test that scanner can be intialized
This commit is contained in:
parent
c488f78148
commit
41283f9e6b
1 changed files with 44 additions and 0 deletions
44
test/scanner/client.test.ts
Normal file
44
test/scanner/client.test.ts
Normal file
|
|
@ -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: '<div>Hello World</div>',
|
||||
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 )
|
||||
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue