<#642 undefined method `strip' for nil:NilClass wh...
# pact-js-development
g
#642 undefined method `strip' for nil:NilClass when verifying provider Issue created by kiennt23 Software versionsOS: _e.g. Mac OSX 11.2.3 (20D91) • Consumer Pact library: _e.g. Pact JS v9.15.3 • Provider Pact library: _e.g. Pact JS v9.15.3 • Node Version: 12.21.0_1 Issue Checklist Please confirm the following: ☑︎ I have upgraded to the latest ☑︎ I have the read the FAQs in the Readme ☑︎ I have triple checked, that there are no unhandled promises in my code ☑︎ I have set my log level to debug and attached a log file showing the complete request/response cycle ☑︎ For bonus points and virtual high fives, I have created a reproduceable git repository (see below) to illustrate the problem Expected behaviour Test pass Actual behaviour Test failed with error:
Copy code
NoMethodError:
       undefined method `strip' for nil:NilClass
Steps to reproduce The contract file is here
Copy code
import { Verifier } from '@pact-foundation/pact';
import { LogLevel } from '@pact-foundation/pact-node/src/service';
import * as path from 'path';

const PACT_ROOT = path.join(__dirname, '../../', 'pact/pacts');

describe('Test An API', () => {
  it('validate the expectations', async () => {
    const defaultState: string = null;
    const opts = {
      logLevel: 'debug' as LogLevel,
      providerBaseUrl: '<https://api.sandbox.dana.id>',
      pactUrls: [path.join(PACT_ROOT, 'test-consumer_test-provider.json')],
      stateHandlers: {
        [defaultState]: async (): Promise<any> => {
          // This is the "default" state handler, when no state is given
        },
      },
    };
    return await new Verifier(opts).verifyProvider();
  });
});
Relevant log files https://gist.github.com/kiennt23/45601e0f9979f7569fbd6f9c8b0489af pact-foundation/pact-js