Skip to content

Commit

Permalink
Only run type tests for node >= 12
Browse files Browse the repository at this point in the history
  • Loading branch information
timfish committed Oct 15, 2022
1 parent b332257 commit ea5e8a8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/nextjs/package.json
Expand Up @@ -67,7 +67,7 @@
"test:all": "run-s test:unit test:integration",
"test:unit": "jest",
"test:integration": "test/run-integration-tests.sh && yarn test:types",
"test:types": "cd test/types/ && yarn && tsc",
"test:types": "cd test/types && yarn && yarn test",
"test:watch": "jest --watch",
"vercel:branch": "source vercel/set-up-branch-for-test-app-use.sh",
"vercel:project": "source vercel/make-project-use-current-branch.sh"
Expand Down
5 changes: 4 additions & 1 deletion packages/nextjs/test/types/package.json
@@ -1,5 +1,8 @@
{
"description": "This is only used to install the nextjs v12 package so we can test against those types",
"description": "This is used to install the nextjs v12 so we can test against those types",
"scripts": {
"test": "ts-node test.ts"
},
"dependencies": {
"next": "12.3.1"
}
Expand Down
8 changes: 8 additions & 0 deletions packages/nextjs/test/types/test.ts
@@ -0,0 +1,8 @@
import { execSync } from 'child_process';
import { parseSemver } from '@sentry/utils';

const NODE_VERSION = parseSemver(process.versions.node);

if (NODE_VERSION.major && NODE_VERSION.major >= 12) {
execSync('tsc --noEmit --project tsconfig.json', { stdio: 'inherit' });
}

0 comments on commit ea5e8a8

Please sign in to comment.