Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Armaldio committed Oct 28, 2024
1 parent 49bdfd7 commit aa8659d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/main/presets/test-c3-unzip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const testC3Unzip: PresetFn = async () => {
},
headless: {
editor: 'editor',
value: true
value: false
}
}
},
Expand Down
28 changes: 19 additions & 9 deletions tests/e2e/tests/basic.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { it, expect, describe, vi } from 'vitest'
import { execa } from 'execa'
import { join } from 'path'
import { dirname, join } from 'path'
import { tmpdir } from 'os'
import { nanoid } from 'nanoid'
import { readFile, writeFile } from 'fs/promises'
import { mkdir, readFile, writeFile } from 'fs/promises'
import { getBinName, name, outFolderName } from '../../../src/constants'
import { platform, arch } from 'process'

Expand Down Expand Up @@ -69,16 +69,26 @@ describe('basic', () => {
it(
'export c3',
async () => {
const { testC3Unzip: project } = await import('../../../src/main/presets/test-c3-unzip')
// const jsonProject = join(fixtures, 'c3-export.json')
const jsonProjectData = JSON.stringify(project)
console.log('jsonProjectData', jsonProjectData)
// const { testC3Unzip } = await import('../../../src/main/presets/test-c3-unzip')

const jsonProject = join(tmpdir(), nanoid(), 'c3-export.json')
// const project = await testC3Unzip()

console.log('jsonProject', jsonProject)
// console.log('project', project)
// // const jsonProject = join(fixtures, 'c3-export.json')
// const jsonProjectData = JSON.stringify(project.data)
// console.log('jsonProjectData', jsonProjectData)

// const jsonProject = join(tmpdir(), nanoid(), 'c3-export.json')

// await mkdir(dirname(jsonProject), {
// recursive: true,
// })

// console.log('jsonProject', jsonProject)

// await writeFile(jsonProject, jsonProjectData)

await writeFile(jsonProject, jsonProjectData)
const jsonProject = join(fixtures, 'c3-export.json')

try {
const { exitCode, stdout, stderr } = await execa(
Expand Down

0 comments on commit aa8659d

Please sign in to comment.