Skip to content

Commit

Permalink
Refactor spec setup to use project based fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
feelepxyz committed Feb 3, 2021
1 parent 1a049a0 commit baf5b13
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 192 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true
},
}
],
"inputs": [
{
Expand Down
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ RUN git clone https://github.com/pyenv/pyenv.git /usr/local/.pyenv \

### JAVASCRIPT

# Install Node 14.0 and Yarn
# Install Node 14.0, Yarn and npm (updated after elm)
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - \
&& apt-get install -y nodejs \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
Expand All @@ -95,6 +95,10 @@ RUN npm install [email protected] \
&& rm -f binaries-for-linux.tar.gz \
&& rm -rf ~/.npm

# NOTE: This is a hack to get around the fact that elm 18 fails to install with
# npm 7, we should look into deprecating elm 18
RUN npm install -g n


### PHP

Expand Down
1 change: 1 addition & 0 deletions npm_and_yarn/helpers/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports = {
verbose: true,
rootDir: "test",
testEnvironment: "node",
};
6 changes: 6 additions & 0 deletions npm_and_yarn/helpers/lib/npm/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const conflictingDependencyParser = require("./conflicting-dependency-parser");

module.exports = {
findConflictingDependencies:
conflictingDependencyParser.findConflictingDependencies,
};
3 changes: 0 additions & 3 deletions npm_and_yarn/helpers/lib/npm6/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
const updater = require("./updater");
const peerDependencyChecker = require("./peer-dependency-checker");
const subdependencyUpdater = require("./subdependency-updater");
const conflictingDependencyParser = require("./conflicting-dependency-parser");

module.exports = {
update: updater.updateDependencyFiles,
updateSubdependency: subdependencyUpdater.updateDependencyFile,
checkPeerDependencies: peerDependencyChecker.checkPeerDependencies,
findConflictingDependencies:
conflictingDependencyParser.findConflictingDependencies,
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const fs = require("fs");
const rimraf = require("rimraf");
const {
findConflictingDependencies,
} = require("../../lib/npm6/conflicting-dependency-parser");
} = require("../../lib/npm/conflicting-dependency-parser");
const helpers = require("./helpers");

describe("findConflictingDependencies", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,9 @@ def conflicting_dependencies(dependency:, target_version:)
# parser doesn't deal with at the moment.
if dependency_files_builder.package_locks.any? ||
dependency_files_builder.shrinkwraps.any?
package_lock = dependency_files_builder.package_locks.find { |f| f.name == "package-lock.json" }
npm_version = Dependabot::NpmAndYarn::Helpers.npm_version(package_lock&.content)
Dependabot.logger.info(npm_version)

SharedHelpers.run_helper_subprocess(
command: NativeHelpers.helper_path,
function: "npm6:findConflictingDependencies",
function: "npm:findConflictingDependencies",
args: [Dir.pwd, dependency.name, target_version.to_s]
)
else
Expand Down
3 changes: 0 additions & 3 deletions npm_and_yarn/package-lock.json

This file was deleted.

Loading

0 comments on commit baf5b13

Please sign in to comment.