diff --git a/.circleci/config.yml b/.circleci/config.yml index b45fb003..b43bf30d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -159,6 +159,26 @@ workflows: branches: ignore: - master + - test-windows: + name: Windows Tests for Node v12 support + context: nodejs-install + node_version: "12.22.12" + requires: + - Lint + filters: + branches: + ignore: + - master + - test-unix: + name: Unix Tests for Node v12 support + context: nodejs-install + node_version: "12.22.12" + requires: + - Lint + filters: + branches: + ignore: + - master - release: name: Release context: nodejs-app-release diff --git a/test/fixtures/bare-npm/package-lock.json b/test/fixtures/bare-npm/package-lock.json new file mode 100644 index 00000000..cd96cdfc --- /dev/null +++ b/test/fixtures/bare-npm/package-lock.json @@ -0,0 +1,12 @@ +{ + "name": "bare-npm", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "bare-npm", + "version": "1.0.0" + } + } +} diff --git a/test/fixtures/bare-npm/package.json b/test/fixtures/bare-npm/package.json new file mode 100644 index 00000000..f2fb8633 --- /dev/null +++ b/test/fixtures/bare-npm/package.json @@ -0,0 +1,4 @@ +{ + "name": "bare-npm", + "version": "1.0.0" +} diff --git a/test/jest/__snapshots__/get-lockfile-version.test.ts.snap b/test/jest/__snapshots__/get-lockfile-version.test.ts.snap new file mode 100644 index 00000000..aae10e0c --- /dev/null +++ b/test/jest/__snapshots__/get-lockfile-version.test.ts.snap @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`getLockfileVersionFromFile npm 1`] = `"NPM_LOCK_V2"`; diff --git a/test/jest/get-lockfile-version.test.ts b/test/jest/get-lockfile-version.test.ts new file mode 100644 index 00000000..51f27538 --- /dev/null +++ b/test/jest/get-lockfile-version.test.ts @@ -0,0 +1,10 @@ +import { getLockfileVersionFromFile } from '../../lib/utils'; + +describe('getLockfileVersionFromFile', () => { + it('npm', () => { + const result = getLockfileVersionFromFile( + `${__dirname}/../fixtures/bare-npm/package-lock.json`, + ); + expect(result).toMatchSnapshot(); + }); +});