Skip to content

Commit 416f9f5

Browse files
committed
provider → scanner
1 parent 9dea776 commit 416f9f5

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

provider.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import {expect, test} from 'bun:test';
2-
import {provider} from './src/index.ts';
2+
import {scanner} from './src/index.ts';
33

44
/////////////////////////////////////////////////////////////////////////////////////
55
// This test file is mostly just here to get you up and running quickly. It's
66
// likely you'd want to improve or remove this, and add more coverage for your
77
// own code.
88
/////////////////////////////////////////////////////////////////////////////////////
99

10-
test('Provider should warn about known malicious packages', async () => {
11-
const advisories = await provider.scan({
10+
test('Scanner should warn about known malicious packages', async () => {
11+
const advisories = await scanner.scan({
1212
packages: [
1313
{
1414
name: 'event-stream',
@@ -32,12 +32,12 @@ test('Provider should warn about known malicious packages', async () => {
3232
});
3333

3434
test('There should be no advisories if no packages are being installed', async () => {
35-
const advisories = await provider.scan({packages: []});
35+
const advisories = await scanner.scan({packages: []});
3636
expect(advisories.length).toBe(0);
3737
});
3838

3939
test('Safe packages should return no advisories', async () => {
40-
const advisories = await provider.scan({
40+
const advisories = await scanner.scan({
4141
packages: [
4242
{
4343
name: 'lodash',
@@ -51,7 +51,7 @@ test('Safe packages should return no advisories', async () => {
5151
});
5252

5353
test('Should handle multiple packages with mixed security status', async () => {
54-
const advisories = await provider.scan({
54+
const advisories = await scanner.scan({
5555
packages: [
5656
{
5757
name: 'event-stream',
@@ -73,7 +73,7 @@ test('Should handle multiple packages with mixed security status', async () => {
7373
});
7474

7575
test('Should differentiate between versions of the same package', async () => {
76-
const maliciousVersion = await provider.scan({
76+
const maliciousVersion = await scanner.scan({
7777
packages: [
7878
{
7979
name: 'event-stream',
@@ -84,7 +84,7 @@ test('Should differentiate between versions of the same package', async () => {
8484
],
8585
});
8686

87-
const safeVersion = await provider.scan({
87+
const safeVersion = await scanner.scan({
8888
packages: [
8989
{
9090
name: 'event-stream',
@@ -100,7 +100,7 @@ test('Should differentiate between versions of the same package', async () => {
100100
});
101101

102102
test('Should handle scoped packages correctly', async () => {
103-
const advisories = await provider.scan({
103+
const advisories = await scanner.scan({
104104
packages: [
105105
{
106106
name: '@types/node',

0 commit comments

Comments
 (0)