-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: migrate all int test to new util (#635)
- Loading branch information
Showing
82 changed files
with
853 additions
and
1,247 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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,12 @@ | ||
import { | ||
assertFilesContent, | ||
createIntegrationTest, | ||
} from '../../../testing-utils' | ||
import { assertFilesContent, createJob } from '../../../testing-utils' | ||
|
||
describe('integration bin/cts', () => { | ||
const { distDir } = createJob({ | ||
directory: __dirname, | ||
}) | ||
it('should work with bin as .cts extension', async () => { | ||
await createIntegrationTest( | ||
{ | ||
directory: __dirname, | ||
}, | ||
async ({ distDir }) => { | ||
await assertFilesContent(distDir, { | ||
'bin/index.cjs': '#!/usr/bin/env node', | ||
}) | ||
}, | ||
) | ||
await assertFilesContent(distDir, { | ||
'bin/index.cjs': '#!/usr/bin/env node', | ||
}) | ||
}) | ||
}) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,16 @@ | ||
import { | ||
createIntegrationTest, | ||
assertContainFiles, | ||
assertFilesContent, | ||
createJob, | ||
} from '../../../testing-utils' | ||
|
||
describe('integration bin/patch-binary', () => { | ||
const { distDir } = createJob({ directory: __dirname }) | ||
it('should patch binary directive', async () => { | ||
await createIntegrationTest( | ||
{ | ||
directory: __dirname, | ||
}, | ||
async ({ distDir }) => { | ||
const distFiles = ['bin.js'] | ||
await assertContainFiles(distDir, distFiles) | ||
await assertFilesContent(distDir, { | ||
'bin.js': "#!/usr/bin/env node\nconsole.log('Hello, world!');", | ||
}) | ||
}, | ||
) | ||
const distFiles = ['bin.js'] | ||
await assertContainFiles(distDir, distFiles) | ||
await assertFilesContent(distDir, { | ||
'bin.js': "#!/usr/bin/env node\nconsole.log('Hello, world!');", | ||
}) | ||
}) | ||
}) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,10 @@ | ||
import { createIntegrationTest, assertFilesContent } from '../../testing-utils' | ||
import { assertFilesContent, createJob } from '../../testing-utils' | ||
|
||
describe('browserslist', () => { | ||
const { distDir } = createJob({ directory: __dirname }) | ||
it('should work with basic JSX format', async () => { | ||
await createIntegrationTest( | ||
{ | ||
directory: __dirname, | ||
}, | ||
({ distDir }) => { | ||
assertFilesContent(distDir, { | ||
'index.js': `_class_private_field_loose_key`, | ||
}) | ||
}, | ||
) | ||
await assertFilesContent(distDir, { | ||
'index.js': `_class_private_field_loose_key`, | ||
}) | ||
}) | ||
}) |
17 changes: 5 additions & 12 deletions
17
test/integration/conflicted-entry/conflicted-entry.test.ts
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 |
---|---|---|
@@ -1,17 +1,10 @@ | ||
import { createIntegrationTest } from '../../testing-utils' | ||
import { createJob } from '../../testing-utils' | ||
|
||
describe('integration - conflicted-entry', () => { | ||
const { job } = createJob({ directory: __dirname }) | ||
it('should error on conflicted entries', async () => { | ||
await createIntegrationTest( | ||
{ | ||
directory: __dirname, | ||
}, | ||
async ({ code, stderr }) => { | ||
expect(code).toBe(1) | ||
expect(stderr).toContain( | ||
'Conflicted entry files found for entries: ./foo', | ||
) | ||
}, | ||
) | ||
const { code, stderr } = job | ||
expect(code).toBe(1) | ||
expect(stderr).toContain('Conflicted entry files found for entries: ./foo') | ||
}) | ||
}) |
Oops, something went wrong.