Skip to content

Commit 5fb8ac2

Browse files
committed
Clean up
1 parent 600adda commit 5fb8ac2

20 files changed

+46
-136
lines changed

packages/nextjs/jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ module.exports = {
44
...baseConfig,
55
// This prevents the build tests from running when unit tests run. (If they do, they fail, because the build being
66
// tested hasn't necessarily run yet.)
7-
testPathIgnorePatterns: ['<rootDir>/test/buildProcess/'],
7+
testPathIgnorePatterns: ['<rootDir>/test/buildProcess/', '<rootDir>/test/integration/'],
88
};

packages/nextjs/src/config/webpack.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { getSentryRelease } from '@sentry/node';
44
import { arrayify, dropUndefinedKeys, escapeStringForRegex, logger, stringMatchesSomePattern } from '@sentry/utils';
55
import { default as SentryWebpackPlugin } from '@sentry/webpack-plugin';
6-
import chalk from 'chalk';
6+
import * as chalk from 'chalk';
77
import * as fs from 'fs';
88
import * as path from 'path';
99

packages/nextjs/test/integration/test/server/cjsApiEndpoints.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NextTestEnv } from '../utils/server';
1+
import { NextTestEnv } from './utils/helpers';
22

33
describe('CommonJS API Endpoints', () => {
44
it('should not intercept unwrapped request', async () => {

packages/nextjs/test/integration/test/server/doubleEndMethodOnVercel.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NextTestEnv } from '../utils/server';
1+
import { NextTestEnv } from './utils/helpers';
22

33
// This test asserts that our wrapping of `res.end` doesn't break API routes on Vercel if people call `res.json` or
44
// `res.send` multiple times in one request handler.

packages/nextjs/test/integration/test/server/errorApiEndpoint.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NextTestEnv } from '../utils/server';
1+
import { NextTestEnv } from './utils/helpers';
22

33
jest.spyOn(console, 'error').mockImplementation();
44

packages/nextjs/test/integration/test/server/errorServerSideProps.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NextTestEnv } from '../utils/server';
1+
import { NextTestEnv } from './utils/helpers';
22

33
describe('Error Server-side Props', () => {
44
it('should capture an error event', async () => {

packages/nextjs/test/integration/test/server/excludedApiEndpoints.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NextTestEnv } from '../utils/server';
1+
import { NextTestEnv } from './utils/helpers';
22

33
describe('Excluded API Endpoints', () => {
44
it('Should exclude API endpoint via RegExp', async () => {

packages/nextjs/test/integration/test/server/tracing200.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NextTestEnv } from '../utils/server';
1+
import { NextTestEnv } from './utils/helpers';
22

33
describe('Tracing 200', () => {
44
it('should capture a transaction', async () => {

packages/nextjs/test/integration/test/server/tracing500.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NextTestEnv } from '../utils/server';
1+
import { NextTestEnv } from './utils/helpers';
22

33
describe('Tracing 500', () => {
44
it('should capture an erroneous transaction', async () => {

packages/nextjs/test/integration/test/server/tracingHttp.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NextTestEnv } from '../utils/server';
1+
import { NextTestEnv } from './utils/helpers';
22
import nock from 'nock';
33

44
describe('Tracing HTTP', () => {

packages/nextjs/test/integration/test/server/tracingServerGetInitialProps.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NextTestEnv } from '../utils/server';
1+
import { NextTestEnv } from './utils/helpers';
22

33
describe('getInitialProps', () => {
44
it('should capture a transaction', async () => {

packages/nextjs/test/integration/test/server/tracingServerGetServerSideProps.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NextTestEnv } from '../utils/server';
1+
import { NextTestEnv } from './utils/helpers';
22

33
describe('getServerSideProps', () => {
44
it('should capture a transaction', async () => {

packages/nextjs/test/integration/test/server/tracingServerGetServerSidePropsCustomPageExtension.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NextTestEnv } from '../utils/server';
1+
import { NextTestEnv } from './utils/helpers';
22

33
describe('tracingServerGetServerSidePropsCustomPageExtension', () => {
44
it('should capture a transaction', async () => {

packages/nextjs/test/integration/test/server/tracingWithSentryAPI.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NextTestEnv } from '../utils/server';
1+
import { NextTestEnv } from './utils/helpers';
22

33
const cases = [
44
{
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { getPortPromise } from 'portfinder';
2+
import { TestEnv } from '../../../../../../node-integration-tests/utils';
3+
import * as http from 'http';
4+
import * as path from 'path';
5+
import { createNextServer, startServer } from '../../utils/common';
6+
7+
export class NextTestEnv extends TestEnv {
8+
private constructor(public readonly server: http.Server, public readonly url: string) {
9+
super(server, url);
10+
}
11+
12+
public static async init(): Promise<NextTestEnv> {
13+
const port = await getPortPromise();
14+
const server = await createNextServer({
15+
dev: false,
16+
dir: path.resolve(__dirname, '../../..'),
17+
});
18+
19+
await startServer(server, port);
20+
21+
return new NextTestEnv(server, `http://localhost:${port}`);
22+
}
23+
}

packages/nextjs/test/integration/test/utils/server.ts

Lines changed: 0 additions & 119 deletions
This file was deleted.

packages/nextjs/test/integration/tsconfig.test.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"include": ["test/**/*"],
55

66
"compilerOptions": {
7-
"types": ["node", "jest"]
7+
"types": ["node", "jest"],
8+
"esModuleInterop": true
89
}
910
}

packages/nextjs/test/tsconfig.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,10 @@
44
{
55
"extends": "../tsconfig.test.json",
66

7-
"include": ["./**/*", "../playwright.config.ts"]
7+
"include": ["./**/*", "../playwright.config.ts"],
8+
9+
"compilerOptions": {
10+
"types": ["node", "jest"],
11+
"esModuleInterop": true
12+
}
813
}

packages/nextjs/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"include": ["src/**/*"],
55

66
"compilerOptions": {
7-
"esModuleInterop": true
87
// package-specific options
98
}
109
}

packages/nextjs/tsconfig.test.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"include": ["test/**/*"],
55

66
"compilerOptions": {
7+
"esModuleInterop": true,
78
// should include all types from `./tsconfig.json` plus types for all test frameworks used
89
"types": ["node", "jest"]
910

0 commit comments

Comments
 (0)