refactor: more cleanup #164

Merged
mcataford merged 11 commits from more-refactor into master 2021-03-19 20:49:27 +00:00
2 changed files with 6 additions and 6 deletions
Showing only changes of commit dd8958875f - Show all commits

View file

@ -204,7 +204,9 @@ describe('Packwatch', () => {
unpackedSize: '140B',
})
await packwatch({ cwd: workspacePath })
await expect(async () =>
packwatch({ cwd: workspacePath }),
).rejects.toThrow('PACKAGE_EXCEEDS_LIMIT')
expect(mockLogger.mock.calls).toHaveLength(1)
expect(mockLogger.mock.calls[0][0]).toEqual(
expect.stringMatching(

View file

@ -36,11 +36,9 @@ export default async function packwatch({
console.log(
'❗ It looks like you ran PackWatch without a manifest. To prevent accidental passes in CI or hooks, packwatch will terminate with an error. If you are running packwatch for the first time in your project, this is expected!',
)
throw new Error('NO_MANIFEST_NO_UPDATE')
}
// If the update flag wasn't specified, exit with a non-zero code so we
// don't "accidentally" pass CI builds if the manifest didn't exist
if (!isUpdatingManifest) throw new Error()
else return
return
}
const previousStats = getPreviousPackageStats(cwd)
@ -79,7 +77,7 @@ export default async function packwatch({
console.log(
`🔥🔥📦🔥🔥 Your package exceeds the limit set in ${MANIFEST_FILENAME}! ${packageSize} > ${limit}\nEither update the limit by using the --update-manifest flag or trim down your packed files!`,
)
return
throw new Error('PACKAGE_EXCEEDS_LIMIT')
}
/*