approvals / approvals/Approvals.NodeJS

Is the "verifyAndScrub" function still available?

Open
#585 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
125
Forks
46
Avg merge
2m
Merged PRs (30d)
16

Description

I've been trying to upgrade from an older version to the latest version. I noticed that the "verifyAndScrub" function is no longer available. Is this intentional, as it is still described in the documentation.

When I run this code:

const path = require("node:path");
const approvals = require("approvals");
const Scrubbers = require('approvals/lib/Scrubbers/Scrubbers').Scrubbers;
const { Subject } = require('./Subject');

const approvalsDirName = path.join(__dirname, 'approvals');

describe('Approval tests', function() {

    it('should do something', function() {
        const output = Subject.doSomething();
        approvals.verifyAndScrub(approvalsDirName, 'doSomething', output, dateScrubber());
    });

    function dateScrubber() {
        const regex = /[a-zA-Z]{3} [a-zA-Z]{3} \d{2} \d{4} \d{2}:\d{2}:\d{2} [a-zA-Z]{3}\+\d{4} \(.*\)/g
        return Scrubbers.createReqexScrubber(regex, t => `<date_${t}>`);
    }
});

I get the following error: TypeError: approvals.verifyAndScrub is not a function

I've included a test project to simulate this. Am I missing something?
Thanks in advance.

approvals-test.zip

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the README section linked in the report and reproduce the TypeError using the attached approvals-test project. Inspect the package's public API to determine whether verifyAndScrub was removed or is missing from the export; done means the documented API and released behavior agree, with a focused test or documentation correction.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs, typescript
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.