Skip to content

Commit

Permalink
import-deps check: don't emit skip test in @tapjs/test
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Oct 8, 2023
1 parent 0827682 commit 56186de
Show file tree
Hide file tree
Showing 35 changed files with 175 additions and 70 deletions.
7 changes: 5 additions & 2 deletions src/after-each/test/import-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ for (const file of files) {
}
}

if (!foundIn.size && !Object.keys(deps).length) {
t.pass('no deps')
if (
!foundIn.size &&
(pkgName === '@tapjs/test' || !Object.keys(deps).length)
) {
t.pass('no deps to check')
} else {
if (pkgName !== '@tapjs/test') {
for (const dep of Object.keys(deps)) {
Expand Down
7 changes: 5 additions & 2 deletions src/after/test/import-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ for (const file of files) {
}
}

if (!foundIn.size && !Object.keys(deps).length) {
t.pass('no deps')
if (
!foundIn.size &&
(pkgName === '@tapjs/test' || !Object.keys(deps).length)
) {
t.pass('no deps to check')
} else {
if (pkgName !== '@tapjs/test') {
for (const dep of Object.keys(deps)) {
Expand Down
7 changes: 5 additions & 2 deletions src/asserts/test/import-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ for (const file of files) {
}
}

if (!foundIn.size && !Object.keys(deps).length) {
t.pass('no deps')
if (
!foundIn.size &&
(pkgName === '@tapjs/test' || !Object.keys(deps).length)
) {
t.pass('no deps to check')
} else {
if (pkgName !== '@tapjs/test') {
for (const dep of Object.keys(deps)) {
Expand Down
7 changes: 5 additions & 2 deletions src/before-each/test/import-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ for (const file of files) {
}
}

if (!foundIn.size && !Object.keys(deps).length) {
t.pass('no deps')
if (
!foundIn.size &&
(pkgName === '@tapjs/test' || !Object.keys(deps).length)
) {
t.pass('no deps to check')
} else {
if (pkgName !== '@tapjs/test') {
for (const dep of Object.keys(deps)) {
Expand Down
7 changes: 5 additions & 2 deletions src/before/test/import-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ for (const file of files) {
}
}

if (!foundIn.size && !Object.keys(deps).length) {
t.pass('no deps')
if (
!foundIn.size &&
(pkgName === '@tapjs/test' || !Object.keys(deps).length)
) {
t.pass('no deps to check')
} else {
if (pkgName !== '@tapjs/test') {
for (const dep of Object.keys(deps)) {
Expand Down
7 changes: 5 additions & 2 deletions src/clock/test/import-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ for (const file of files) {
}
}

if (!foundIn.size && !Object.keys(deps).length) {
t.pass('no deps')
if (
!foundIn.size &&
(pkgName === '@tapjs/test' || !Object.keys(deps).length)
) {
t.pass('no deps to check')
} else {
if (pkgName !== '@tapjs/test') {
for (const dep of Object.keys(deps)) {
Expand Down
7 changes: 5 additions & 2 deletions src/config/test/import-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ for (const file of files) {
}
}

if (!foundIn.size && !Object.keys(deps).length) {
t.pass('no deps')
if (
!foundIn.size &&
(pkgName === '@tapjs/test' || !Object.keys(deps).length)
) {
t.pass('no deps to check')
} else {
if (pkgName !== '@tapjs/test') {
for (const dep of Object.keys(deps)) {
Expand Down
7 changes: 5 additions & 2 deletions src/core/test/import-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ for (const file of files) {
}
}

if (!foundIn.size && !Object.keys(deps).length) {
t.pass('no deps')
if (
!foundIn.size &&
(pkgName === '@tapjs/test' || !Object.keys(deps).length)
) {
t.pass('no deps to check')
} else {
if (pkgName !== '@tapjs/test') {
for (const dep of Object.keys(deps)) {
Expand Down
7 changes: 5 additions & 2 deletions src/create-plugin/test/import-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ for (const file of files) {
}
}

if (!foundIn.size && !Object.keys(deps).length) {
t.pass('no deps')
if (
!foundIn.size &&
(pkgName === '@tapjs/test' || !Object.keys(deps).length)
) {
t.pass('no deps to check')
} else {
if (pkgName !== '@tapjs/test') {
for (const dep of Object.keys(deps)) {
Expand Down
7 changes: 5 additions & 2 deletions src/dummy-plugin/test/import-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ for (const file of files) {
}
}

if (!foundIn.size && !Object.keys(deps).length) {
t.pass('no deps')
if (
!foundIn.size &&
(pkgName === '@tapjs/test' || !Object.keys(deps).length)
) {
t.pass('no deps to check')
} else {
if (pkgName !== '@tapjs/test') {
for (const dep of Object.keys(deps)) {
Expand Down
7 changes: 5 additions & 2 deletions src/error-serdes/test/import-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ for (const file of files) {
}
}

if (!foundIn.size && !Object.keys(deps).length) {
t.pass('no deps')
if (
!foundIn.size &&
(pkgName === '@tapjs/test' || !Object.keys(deps).length)
) {
t.pass('no deps to check')
} else {
if (pkgName !== '@tapjs/test') {
for (const dep of Object.keys(deps)) {
Expand Down
7 changes: 5 additions & 2 deletions src/esbuild-kit/test/import-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ for (const file of files) {
}
}

if (!foundIn.size && !Object.keys(deps).length) {
t.pass('no deps')
if (
!foundIn.size &&
(pkgName === '@tapjs/test' || !Object.keys(deps).length)
) {
t.pass('no deps to check')
} else {
if (pkgName !== '@tapjs/test') {
for (const dep of Object.keys(deps)) {
Expand Down
7 changes: 5 additions & 2 deletions src/filter/test/import-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ for (const file of files) {
}
}

if (!foundIn.size && !Object.keys(deps).length) {
t.pass('no deps')
if (
!foundIn.size &&
(pkgName === '@tapjs/test' || !Object.keys(deps).length)
) {
t.pass('no deps to check')
} else {
if (pkgName !== '@tapjs/test') {
for (const dep of Object.keys(deps)) {
Expand Down
7 changes: 5 additions & 2 deletions src/fixture/test/import-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ for (const file of files) {
}
}

if (!foundIn.size && !Object.keys(deps).length) {
t.pass('no deps')
if (
!foundIn.size &&
(pkgName === '@tapjs/test' || !Object.keys(deps).length)
) {
t.pass('no deps to check')
} else {
if (pkgName !== '@tapjs/test') {
for (const dep of Object.keys(deps)) {
Expand Down
7 changes: 5 additions & 2 deletions src/intercept/test/import-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ for (const file of files) {
}
}

if (!foundIn.size && !Object.keys(deps).length) {
t.pass('no deps')
if (
!foundIn.size &&
(pkgName === '@tapjs/test' || !Object.keys(deps).length)
) {
t.pass('no deps to check')
} else {
if (pkgName !== '@tapjs/test') {
for (const dep of Object.keys(deps)) {
Expand Down
7 changes: 5 additions & 2 deletions src/mocha-globals/test/import-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ for (const file of files) {
}
}

if (!foundIn.size && !Object.keys(deps).length) {
t.pass('no deps')
if (
!foundIn.size &&
(pkgName === '@tapjs/test' || !Object.keys(deps).length)
) {
t.pass('no deps to check')
} else {
if (pkgName !== '@tapjs/test') {
for (const dep of Object.keys(deps)) {
Expand Down
7 changes: 5 additions & 2 deletions src/mock/test/import-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ for (const file of files) {
}
}

if (!foundIn.size && !Object.keys(deps).length) {
t.pass('no deps')
if (
!foundIn.size &&
(pkgName === '@tapjs/test' || !Object.keys(deps).length)
) {
t.pass('no deps to check')
} else {
if (pkgName !== '@tapjs/test') {
for (const dep of Object.keys(deps)) {
Expand Down
7 changes: 5 additions & 2 deletions src/nock/test/import-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ for (const file of files) {
}
}

if (!foundIn.size && !Object.keys(deps).length) {
t.pass('no deps')
if (
!foundIn.size &&
(pkgName === '@tapjs/test' || !Object.keys(deps).length)
) {
t.pass('no deps to check')
} else {
if (pkgName !== '@tapjs/test') {
for (const dep of Object.keys(deps)) {
Expand Down
7 changes: 5 additions & 2 deletions src/node-serialize/test/import-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ for (const file of files) {
}
}

if (!foundIn.size && !Object.keys(deps).length) {
t.pass('no deps')
if (
!foundIn.size &&
(pkgName === '@tapjs/test' || !Object.keys(deps).length)
) {
t.pass('no deps to check')
} else {
if (pkgName !== '@tapjs/test') {
for (const dep of Object.keys(deps)) {
Expand Down
7 changes: 5 additions & 2 deletions src/npm-init-template/test/import-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ for (const file of files) {
}
}

if (!foundIn.size && !Object.keys(deps).length) {
t.pass('no deps')
if (
!foundIn.size &&
(pkgName === '@tapjs/test' || !Object.keys(deps).length)
) {
t.pass('no deps to check')
} else {
if (pkgName !== '@tapjs/test') {
for (const dep of Object.keys(deps)) {
Expand Down
7 changes: 5 additions & 2 deletions src/parser/test/import-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ for (const file of files) {
}
}

if (!foundIn.size && !Object.keys(deps).length) {
t.pass('no deps')
if (
!foundIn.size &&
(pkgName === '@tapjs/test' || !Object.keys(deps).length)
) {
t.pass('no deps to check')
} else {
if (pkgName !== '@tapjs/test') {
for (const dep of Object.keys(deps)) {
Expand Down
7 changes: 5 additions & 2 deletions src/reporter/test/import-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ for (const file of files) {
}
}

if (!foundIn.size && !Object.keys(deps).length) {
t.pass('no deps')
if (
!foundIn.size &&
(pkgName === '@tapjs/test' || !Object.keys(deps).length)
) {
t.pass('no deps to check')
} else {
if (pkgName !== '@tapjs/test') {
for (const dep of Object.keys(deps)) {
Expand Down
7 changes: 5 additions & 2 deletions src/run/test/import-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ for (const file of files) {
}
}

if (!foundIn.size && !Object.keys(deps).length) {
t.pass('no deps')
if (
!foundIn.size &&
(pkgName === '@tapjs/test' || !Object.keys(deps).length)
) {
t.pass('no deps to check')
} else {
if (pkgName !== '@tapjs/test') {
for (const dep of Object.keys(deps)) {
Expand Down
7 changes: 5 additions & 2 deletions src/sinon/test/import-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ for (const file of files) {
}
}

if (!foundIn.size && !Object.keys(deps).length) {
t.pass('no deps')
if (
!foundIn.size &&
(pkgName === '@tapjs/test' || !Object.keys(deps).length)
) {
t.pass('no deps to check')
} else {
if (pkgName !== '@tapjs/test') {
for (const dep of Object.keys(deps)) {
Expand Down
7 changes: 5 additions & 2 deletions src/snapshot/test/import-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ for (const file of files) {
}
}

if (!foundIn.size && !Object.keys(deps).length) {
t.pass('no deps')
if (
!foundIn.size &&
(pkgName === '@tapjs/test' || !Object.keys(deps).length)
) {
t.pass('no deps to check')
} else {
if (pkgName !== '@tapjs/test') {
for (const dep of Object.keys(deps)) {
Expand Down
7 changes: 5 additions & 2 deletions src/spawn/test/import-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ for (const file of files) {
}
}

if (!foundIn.size && !Object.keys(deps).length) {
t.pass('no deps')
if (
!foundIn.size &&
(pkgName === '@tapjs/test' || !Object.keys(deps).length)
) {
t.pass('no deps to check')
} else {
if (pkgName !== '@tapjs/test') {
for (const dep of Object.keys(deps)) {
Expand Down
7 changes: 5 additions & 2 deletions src/stack/test/import-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ for (const file of files) {
}
}

if (!foundIn.size && !Object.keys(deps).length) {
t.pass('no deps')
if (
!foundIn.size &&
(pkgName === '@tapjs/test' || !Object.keys(deps).length)
) {
t.pass('no deps to check')
} else {
if (pkgName !== '@tapjs/test') {
for (const dep of Object.keys(deps)) {
Expand Down
7 changes: 5 additions & 2 deletions src/stdin/test/import-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ for (const file of files) {
}
}

if (!foundIn.size && !Object.keys(deps).length) {
t.pass('no deps')
if (
!foundIn.size &&
(pkgName === '@tapjs/test' || !Object.keys(deps).length)
) {
t.pass('no deps to check')
} else {
if (pkgName !== '@tapjs/test') {
for (const dep of Object.keys(deps)) {
Expand Down
Loading

0 comments on commit 56186de

Please sign in to comment.