Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: Ensure to fully cleanup serverless installation when testing plugins #10250

Merged
merged 1 commit into from Nov 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions test/fixtures/programmatic/curated-plugins/_setup.js
Expand Up @@ -3,7 +3,12 @@
const path = require('path');
const fsp = require('fs').promises;

const slsDependencyDir = path.resolve(__dirname, 'node_modules/serverless');
const nodeModulesDir = path.resolve(__dirname, 'node_modules');

// Ensure to remove "serverless" installed as peer-dependency to avoid local fallback
module.exports = async () => fsp.rm(slsDependencyDir, { recursive: true, force: true });
module.exports = async () =>
Promise.all([
fsp.rm(path.resolve(nodeModulesDir, 'serverless'), { recursive: true, force: true }),
fsp.unlink(path.resolve(nodeModulesDir, '.bin/serverless')).catch(() => {}),
fsp.unlink(path.resolve(nodeModulesDir, '.bin/sls')).catch(() => {}),
]);