Skip to content

Commit

Permalink
chore: refactor smoke-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys authored and fritzy committed Apr 13, 2022
1 parent 3f7fe17 commit 672fce8
Show file tree
Hide file tree
Showing 19 changed files with 344 additions and 443 deletions.
1 change: 0 additions & 1 deletion .eslintrc.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"overrides": [{
"files": [
"scripts/**",
"smoke-tests/**",
"bin/**",
"test/**"
],
Expand Down
1 change: 1 addition & 0 deletions node_modules/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ readme*
/side-channel
/simple-concat
/simple-get
/smoke-tests
/source-map
/source-map-support
/space-separated-tokens
Expand Down
45 changes: 42 additions & 3 deletions package-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"license": "Artistic-2.0",
"workspaces": [
"docs",
"smoke-tests",
"workspaces/*"
],
"dependencies": {
Expand Down Expand Up @@ -5795,7 +5796,8 @@
},
"node_modules/promise-all-reject-late": {
"version": "1.0.1",
"license": "ISC",
"resolved": "https://registry.npmjs.org/promise-all-reject-late/-/promise-all-reject-late-1.0.1.tgz",
"integrity": "sha512-vuf0Lf0lOxyQREH7GDIOUMLS7kz+gs8i6B+Yi8dC68a2sychGrHTJYghMBD6k7eUcH0H5P73EckCA48xijWqXw==",
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
Expand Down Expand Up @@ -6282,8 +6284,9 @@
},
"node_modules/rimraf": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
"integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
"inBundle": true,
"license": "ISC",
"dependencies": {
"glob": "^7.1.3"
},
Expand Down Expand Up @@ -6447,6 +6450,10 @@
"npm": ">= 3.0.0"
}
},
"node_modules/smoke-tests": {
"resolved": "smoke-tests",
"link": true
},
"node_modules/socks": {
"version": "2.6.2",
"inBundle": true,
Expand Down Expand Up @@ -9737,6 +9744,22 @@
"url": "https://github.com/sponsors/wooorm"
}
},
"smoke-tests": {
"version": "1.0.0",
"license": "ISC",
"devDependencies": {
"@npmcli/eslint-config": "^3.0.1",
"@npmcli/promise-spawn": "^3.0.0",
"@npmcli/template-oss": "3.3.2",
"minify-registry-metadata": "^2.2.0",
"rimraf": "^3.0.2",
"tap": "^16.0.1",
"which": "^2.0.2"
},
"engines": {
"node": "^12.13.0 || ^14.15.0 || >=16.0.0"
}
},
"workspaces/arborist": {
"name": "@npmcli/arborist",
"version": "5.0.5",
Expand Down Expand Up @@ -13792,7 +13815,9 @@
}
},
"promise-all-reject-late": {
"version": "1.0.1"
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/promise-all-reject-late/-/promise-all-reject-late-1.0.1.tgz",
"integrity": "sha512-vuf0Lf0lOxyQREH7GDIOUMLS7kz+gs8i6B+Yi8dC68a2sychGrHTJYghMBD6k7eUcH0H5P73EckCA48xijWqXw=="
},
"promise-call-limit": {
"version": "1.0.1"
Expand Down Expand Up @@ -14117,6 +14142,8 @@
},
"rimraf": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
"integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
"requires": {
"glob": "^7.1.3"
}
Expand Down Expand Up @@ -14192,6 +14219,18 @@
"smart-buffer": {
"version": "4.2.0"
},
"smoke-tests": {
"version": "file:smoke-tests",
"requires": {
"@npmcli/eslint-config": "^3.0.1",
"@npmcli/promise-spawn": "^3.0.0",
"@npmcli/template-oss": "3.3.2",
"minify-registry-metadata": "^2.2.0",
"rimraf": "^3.0.2",
"tap": "^16.0.1",
"which": "^2.0.2"
}
},
"socks": {
"version": "2.6.2",
"requires": {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "a package manager for JavaScript",
"workspaces": [
"docs",
"smoke-tests",
"workspaces/*"
],
"files": [
Expand Down Expand Up @@ -225,8 +226,7 @@
"lintfix": "npm run lint -- --fix",
"lint-all": "npm run lint --if-present --workspaces --include-workspace-root",
"prelint": "rimraf test/npm_cache*",
"resetdeps": "bash scripts/resetdeps.sh",
"smoke-tests": "tap smoke-tests/index.js --no-coverage"
"resetdeps": "bash scripts/resetdeps.sh"
},
"tap": {
"test-env": [
Expand Down
1 change: 1 addition & 0 deletions scripts/resetdeps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ set -e
set -x
rm -rf node_modules
rm -rf docs/node_modules
rm -rf smoke-tests/node_modules
rm -rf "workspaces/*/node_modules"
git checkout node_modules
node . i --ignore-scripts --no-audit --no-fund
Expand Down
15 changes: 15 additions & 0 deletions smoke-tests/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* This file is automatically added by @npmcli/template-oss. Do not edit. */

const { readdirSync: readdir } = require('fs')

const localConfigs = readdir(__dirname)
.filter((file) => file.startsWith('.eslintrc.local.'))
.map((file) => `./${file}`)

module.exports = {
root: true,
extends: [
'@npmcli',
...localConfigs,
],
}
21 changes: 21 additions & 0 deletions smoke-tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This file is automatically added by @npmcli/template-oss. Do not edit.

# ignore everything in the root
/*

# keep these
!/.eslintrc.local.*
!**/.gitignore
!/docs/
!/tap-snapshots/
!/test/
!/map.js
!/scripts/
!/README*
!/LICENSE*
!/CHANGELOG*
!/.eslintrc.js
!/.gitignore
!/bin/
!/lib/
!/package.json
49 changes: 49 additions & 0 deletions smoke-tests/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"name": "smoke-tests",
"description": "The npm cli smoke tests",
"version": "1.0.0",
"private": true,
"scripts": {
"lint": "eslint \"**/*.js\"",
"postlint": "template-oss-check",
"template-oss-apply": "template-oss-apply --force",
"lintfix": "npm run lint -- --fix",
"preversion": "npm test",
"postversion": "git push origin --follow-tags",
"snap": "tap",
"test": "tap",
"posttest": "npm run lint"
},
"repository": {
"type": "git",
"url": "https://github.com/npm/cli.git",
"directory": "smoke-tests"
},
"devDependencies": {
"@npmcli/eslint-config": "^3.0.1",
"@npmcli/promise-spawn": "^3.0.0",
"@npmcli/template-oss": "3.3.2",
"minify-registry-metadata": "^2.2.0",
"rimraf": "^3.0.2",
"tap": "^16.0.1",
"which": "^2.0.2"
},
"author": "GitHub Inc.",
"license": "ISC",
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "3.3.2",
"workspaceRepo": false
},
"tap": {
"no-coverage": true,
"files": "test/index.js"
},
"files": [
"bin/",
"lib/"
],
"engines": {
"node": "^12.13.0 || ^14.15.0 || >=16.0.0"
}
}
Loading

0 comments on commit 672fce8

Please sign in to comment.