Socket
Book a DemoInstallSign in
Socket

memory2

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

memory2

This library provides the capability to transit variables between step and access them from gherkin definitions

0.0.1
unpublished
latest
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

@cucumber-e2e/po2

This library provides the capability to transit variables between step and access them from gherkin definitions

npm install @cucumber-e2e/memory2

Usage

Lib resolves provided value from storage

const memory = require('@cucumber-e2e/memory2');

When(/^save variable as '(.+)'$/, async function (key) {
    memory.setValue(key, 42);
});

Then(/^value '(.+)' should be equal to '(.+)'$/, async function (variable, variable) {
    const val = memory.getValue(variable);
    expect(val).to.equal(variable);
});
When save variable as 'variable'
Then value of '$variable' should be equal to '42'

Using constants and computed

Lib provides capability to set constant values and computed (values that calculated in the moment of call)

module.exports = {
    CONSTANT: 42,
    computed() {
        return Date.now()
    }
};

Register constants and computeds

Before using memory it needs to be registered. The best place to do it is Before hook

const memory = require('@cucumber-e2e/memory2');
const memoryMap = require('./memoryMap.js')
Before(async function() {
    memory.register(memoryMap);
});

FAQs

Package last updated on 17 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.