<commit_before>"use strict";

const oui = require(".");
const nock = require("nock");
const {join} = require("path");
const {test, expect} = global;

nock("https://linuxnet.ca").persist().get("/ieee/oui.txt").replyWithFile(200, join(__dirname, "fixtures/sanitized.txt"));
nock("http://standards.ieee.org").persist().get("/develop/regauth/oui/oui.txt").replyWithFile(200, join(__dirname, "fixtures/sanitized.txt"));

test("oui", () => {
  expect(oui("203706")).toMatch(/cisco/i);
  expect(oui("20:37:06")).toMatch(/cisco/i);
  expect(oui("20:37:6")).toMatch(/cisco/i);
  expect(oui("20:37:06:11:22:33")).toMatch(/cisco/i);
  expect(oui("20:37:6:11:22:33")).toMatch(/cisco/i);
  expect(oui("20370")).toEqual(null);

  expect(() => {oui(null)}).toThrow();
  expect(() => {oui(undefined)}).toThrow();
  expect(() => {oui([])}).toThrow();
  expect(() => {oui("20370", {strict: true})}).toThrow();
  expect(() => {oui("abcd", {strict: true})}).toThrow();
  expect(() => {oui(null, {strict: true})}).toThrow();
  expect(() => {oui(undefined, {strict: true})}).toThrow();
});

test("oui.search", () => {
  expect(oui.search("*Juniper Systems*").length >= 1).toBeTruthy();
  expect(oui.search(["*Juniper Systems*"]).length >= 1).toBeTruthy();
  expect(oui.search(["*Juniper*", "*Systems*"]).length >= 1).toBeTruthy();
});

test("oui.update", async () => {
  expect(await Promise.all([
    oui.update(),
    oui.update({url: "https://linuxnet.ca/ieee/oui.txt"}),
    oui.update({url: "http://standards.ieee.org/develop/regauth/oui/oui.txt"}),
  ])).toEqual([undefined, undefined, undefined]);
});<commit_msg>try different nock init<commit_after>"use strict";

const oui = require(".");
const nock = require("nock");
const {join} = require("path");
const {test, expect, beforeAll, afterAll} = global;

beforeAll(() => {
  nock("https://linuxnet.ca").persist().get("/ieee/oui.txt").replyWithFile(200, join(__dirname, "fixtures/sanitized.txt"));
  nock("http://standards.ieee.org").persist().get("/develop/regauth/oui/oui.txt").replyWithFile(200, join(__dirname, "fixtures/sanitized.txt"));
});

test("oui", () => {
  expect(oui("203706")).toMatch(/cisco/i);
  expect(oui("20:37:06")).toMatch(/cisco/i);
  expect(oui("20:37:6")).toMatch(/cisco/i);
  expect(oui("20:37:06:11:22:33")).toMatch(/cisco/i);
  expect(oui("20:37:6:11:22:33")).toMatch(/cisco/i);
  expect(oui("20370")).toEqual(null);

  expect(() => {oui(null)}).toThrow();
  expect(() => {oui(undefined)}).toThrow();
  expect(() => {oui([])}).toThrow();
  expect(() => {oui("20370", {strict: true})}).toThrow();
  expect(() => {oui("abcd", {strict: true})}).toThrow();
  expect(() => {oui(null, {strict: true})}).toThrow();
  expect(() => {oui(undefined, {strict: true})}).toThrow();
});

test("oui.search", () => {
  expect(oui.search("*Juniper Systems*").length >= 1).toBeTruthy();
  expect(oui.search(["*Juniper Systems*"]).length >= 1).toBeTruthy();
  expect(oui.search(["*Juniper*", "*Systems*"]).length >= 1).toBeTruthy();
});

test("oui.update", async () => {
  expect(await Promise.all([
    oui.update(),
    oui.update({url: "https://linuxnet.ca/ieee/oui.txt"}),
    oui.update({url: "http://standards.ieee.org/develop/regauth/oui/oui.txt"}),
  ])).toEqual([undefined, undefined, undefined]);
});

afterAll(() => {
  nock.cleanAll();
});
{'fraction_non_alphanumeric': 0.28051001821493626, 'fraction_numerical': 0.0358227079538555, 'mean_word_length': 5.793814432989691, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 31, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '991445', 'n_tokens_mistral': 1344, 'n_tokens_neox': 1275, 'n_words': 152}