-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Distribute integration test to single test files (#455)
Co-authored-by: Jiachi Liu <[email protected]>
- Loading branch information
1 parent
a3856b7
commit bbfa097
Showing
70 changed files
with
429 additions
and
263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { createIntegrationTest, assertContainFiles } from '../utils' | ||
|
||
describe('integration', () => { | ||
test(`basic-jsx`, async () => { | ||
await createIntegrationTest( | ||
{ | ||
directory: __dirname, | ||
}, | ||
({ distDir, stderr, stdout }) => { | ||
expect(stderr + stdout).not.toContain('(swc plugin)') | ||
assertContainFiles(distDir, ['index.js', 'index.mjs']) | ||
}, | ||
) | ||
}) | ||
}) |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { readFile } from 'fs/promises' | ||
import { createIntegrationTest, deleteFile, existsFile } from '../../utils' | ||
|
||
afterEach(async () => { | ||
await deleteFile(`${__dirname}/fixtures/tsconfig.json`) | ||
}) | ||
|
||
describe('integration', () => { | ||
test(`bin/cts`, async () => { | ||
await createIntegrationTest( | ||
{ | ||
directory: __dirname, | ||
}, | ||
async ({ distDir }) => { | ||
const distFiles = [ | ||
`${distDir}/bin/index.cjs`, | ||
`${distDir}/bin/index.d.cts`, | ||
] | ||
|
||
for (const distFile of distFiles) { | ||
expect(await existsFile(distFile)).toBe(true) | ||
} | ||
|
||
expect(await readFile(distFiles[0], 'utf-8')).toContain( | ||
'#!/usr/bin/env node', | ||
) | ||
}, | ||
) | ||
}) | ||
}) |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.