diff --git a/packages/plugins/auth-memory/test/index.spec.ts b/packages/plugins/auth-memory/test/index.spec.ts index 658db5b5c..343bee715 100644 --- a/packages/plugins/auth-memory/test/index.spec.ts +++ b/packages/plugins/auth-memory/test/index.spec.ts @@ -1,7 +1,7 @@ import { beforeEach, describe, expect, test, vi } from 'vitest'; import { Config, getDefaultConfig } from '@verdaccio/config'; -import { pluginUtils } from '@verdaccio/core'; +import { API_ERROR, errorUtils, pluginUtils } from '@verdaccio/core'; import Memory from '../src/index'; import { Users, VerdaccioMemoryConfig } from '../src/types'; @@ -307,8 +307,8 @@ describe('Memory', function () { test('fails if user does not exist', function () { return new Promise((done) => { auth.authenticate('john', 'secret', function (err, groups) { - expect(err).toBeNull(); - expect(groups).toBeFalsy(); + expect(err).toEqual(errorUtils.getUnauthorized(API_ERROR.BAD_USERNAME_PASSWORD)); + expect(groups).toBeUndefined(); done(true); }); });