Skip to content

Commit

Permalink
Merge pull request #1294 from snyk/chore/update-run-test-exports
Browse files Browse the repository at this point in the history
chore: update run test exports to modules syntax
  • Loading branch information
lili2311 committed Aug 4, 2020
2 parents f90157d + d538039 commit 59591bf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/lib/snyk-test/index.js
@@ -1,7 +1,7 @@
module.exports = test;

const detect = require('../detect');
const runTest = require('./run-test');
const { runTest } = require('./run-test');
const chalk = require('chalk');
const pm = require('../package-managers');
const iacProjects = require('../iac/iac-projects');
Expand Down
4 changes: 1 addition & 3 deletions src/lib/snyk-test/run-test.ts
Expand Up @@ -62,8 +62,6 @@ const debug = debugModule('snyk');

const ANALYTICS_PAYLOAD_MAX_LENGTH = 1024;

export = runTest;

async function sendAndParseResults(
payloads: Payload[],
spinnerLbl: string,
Expand Down Expand Up @@ -137,7 +135,7 @@ async function sendAndParseResults(
return results;
}

async function runTest(
export async function runTest(
projectType: SupportedProjectTypes | undefined,
root: string,
options: Options & TestOptions,
Expand Down
2 changes: 1 addition & 1 deletion test/acceptance/run-test.test.ts
Expand Up @@ -17,7 +17,7 @@ const before = tap.runOnly ? only : test;
const after = tap.runOnly ? only : test;

// Import has to happen after setting SNYK_API
import runTest = require('../../src/lib/snyk-test/run-test');
import { runTest } from '../../src/lib/snyk-test/run-test';
import { TestOptions, Options } from '../../src/lib/types';

// @later: remove this config stuff.
Expand Down

0 comments on commit 59591bf

Please sign in to comment.