-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Distribute integration test to single test files #455
Merged
huozhi
merged 34 commits into
huozhi:main
from
devjiwonchoi:migrate-integration-test-to-single-test
Feb 18, 2024
Merged
Changes from 28 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
b144164
refactor: move common test utils from cli to testing-utils
devjiwonchoi b53f7ea
refactor: move integration to test utils
devjiwonchoi b9b4d97
test: move basic-jsx
devjiwonchoi ce4e737
refactor: assert for fixtures
devjiwonchoi 040042e
test: move cjs-pkg-esm-main-field
devjiwonchoi 4a2cad6
refactor: add assert fixtures file content
devjiwonchoi f10ab62
test: add default node mjs
devjiwonchoi 76e25dc
test: remove default-node-mjs from integration
devjiwonchoi 1284b60
refactor: reuse the test utils
devjiwonchoi 2b1998e
test: move bin/cts
devjiwonchoi 4a5ba85
Merge branch 'main' of github.com:devjiwonchoi/bunchee into migrate-i…
devjiwonchoi 072cb95
test: remove bin/cts from integration
devjiwonchoi 4a1de65
test: move bin/multi-path
devjiwonchoi b2c367f
test: move bin/single-path
devjiwonchoi 0071760
refactor: receive dist and fixtures dir from create test callback
devjiwonchoi 8376366
test: move dev-prod-convention
devjiwonchoi fffdd21
refactor: add additional files to remove param for running test
devjiwonchoi 6e7267a
chore: apply filesToRemove
devjiwonchoi 1ac54a4
test: move duplicate-entry
devjiwonchoi bb282ae
test: move edge-variable
devjiwonchoi e14c1d9
test: move entry-index-index
devjiwonchoi 439bf6e
test: move esm-pkg-cjs-main-field
devjiwonchoi d711f84
test: move esm-shims
devjiwonchoi 6dd216d
test: move externals
devjiwonchoi c62a3f6
test: move invalid-exports-cjs
devjiwonchoi 6a0bcdd
test: move invalid-exports-esm
devjiwonchoi f83e725
test: move js-only
devjiwonchoi 38cb3ea
refactor: export testing-utils from integrations utils
devjiwonchoi d8d971c
refactor: resolve dist dir directly
devjiwonchoi 546ccdd
refactor: revert passing fixturesDir on createTest callback
devjiwonchoi b06db21
refactor: use distDir param on bin/cts
devjiwonchoi 6827ce3
refactor: import child_process fork as named export
devjiwonchoi 6c4ea5f
refactor: remove filesToRemove, temporarily removing tsconfig.json ma…
devjiwonchoi fd98787
refactor: delete tsconfig file aftereach
devjiwonchoi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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, | ||
}, | ||
({ fixturesDir, stderr, stdout }) => { | ||
expect(stderr + stdout).not.toContain('(swc plugin)') | ||
assertContainFiles(fixturesDir, ['./dist/index.js', './dist/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,27 @@ | ||
import { readFile } from 'fs/promises' | ||
import { createIntegrationTest, existsFile } from '../../utils' | ||
|
||
describe('integration', () => { | ||
test(`bin/cts`, async () => { | ||
await createIntegrationTest( | ||
{ | ||
directory: __dirname, | ||
filesToRemove: ['tsconfig.json'], | ||
}, | ||
async () => { | ||
const distFiles = [ | ||
`${__dirname}/fixtures/dist/bin/index.cjs`, | ||
`${__dirname}/fixtures/dist/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.
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,27 @@ | ||
import { readFile } from 'fs/promises' | ||
import { createIntegrationTest, existsFile } from '../../utils' | ||
|
||
describe('integration', () => { | ||
test(`bin/multi-path`, async () => { | ||
await createIntegrationTest( | ||
{ | ||
directory: __dirname, | ||
filesToRemove: ['tsconfig.json'], | ||
}, | ||
async ({ distDir }) => { | ||
const distBinFiles = [`${distDir}/bin/a.js`, `${distDir}/bin/b.js`] | ||
const distTypeFiles = [`${distDir}/bin/a.d.ts`, `${distDir}/bin/b.d.ts`] | ||
const distFiles = distBinFiles.concat(distTypeFiles) | ||
|
||
for (const distFile of distFiles) { | ||
expect(await existsFile(distFile)).toBe(true) | ||
} | ||
for (const distScriptFile of distBinFiles) { | ||
expect(await readFile(distScriptFile, 'utf-8')).toContain( | ||
'#!/usr/bin/env node', | ||
) | ||
} | ||
}, | ||
) | ||
}) | ||
}) |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to use different names, like "integration - cts" for
describe()
name, then give it("should ..") to describe the expectationThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it! Do you want me to resolve it on this PR or other?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ye not blocking, can follow up later!