# cypress-placeholder-replacer-command

> A cypress command to replace placeholders within json object or string

Latest version **1.0.2** (published 2021-03-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install cypress-placeholder-replacer-command
pnpm add cypress-placeholder-replacer-command
yarn add cypress-placeholder-replacer-command
bun add cypress-placeholder-replacer-command
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2021-03-15 |
| First published | 2021-03-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Benoit Wauthier |
| Maintainers | benoit_wauthier |
| Keywords | Cypress, placeholder, replacer |

## Links

- npm: https://www.npmjs.com/package/cypress-placeholder-replacer-command
- npm.io page: https://npm.io/package/cypress-placeholder-replacer-command

## Dependencies (1)

- [simple-placeholder-replacer](https://npm.io/package/simple-placeholder-replacer.md) ^1.1.0

## Alternatives

- [@snazzah/davey](https://npm.io/package/@snazzah/davey.md) — 1.5M weekly downloads
- [@vendure/testing](https://npm.io/package/@vendure/testing.md) — 8.3K weekly downloads
- [vue-simple-context-menu](https://npm.io/package/vue-simple-context-menu.md) — 6.6K weekly downloads
- [cypress-webpack-preprocessor-v5](https://npm.io/package/cypress-webpack-preprocessor-v5.md) — 2.1K weekly downloads
- [@backstage/plugin-catalog-backend-module-puppetdb](https://npm.io/package/@backstage/plugin-catalog-backend-module-puppetdb.md) — 1.3K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2021-03-15
- 1.0.1 — 2021-03-15
- 1.0.0 — 2021-03-15

## README

# cypress-placeholder-replacer-command
[![Build Status](https://travis-ci.com/BenoitWauthier/cypress-placeholder-replacer-command.svg?branch=main)](https://travis-ci.com/github/BenoitWauthier/cypress-placeholder-replacer-command)
![dependencies Status](https://img.shields.io/david/BenoitWauthier/cypress-placeholder-replacer-command)
![devDependencies Status](https://img.shields.io/david/dev/BenoitWauthier/cypress-placeholder-replacer-command?label=devDependencies)
[![Known Vulnerabilities](https://snyk.io/test/github/BenoitWauthier/cypress-placeholder-replacer-command/badge.svg)](https://snyk.io/test/github/BenoitWauthier/cypress-placeholder-replacer-command)

![Npm version](https://img.shields.io/npm/v/cypress-placeholder-replacer-command?label=latest-version)
![Npm downloads](https://img.shields.io/npm/dm/cypress-placeholder-replacer-command)
![Npm download size](https://img.shields.io/bundlephobia/min/cypress-placeholder-replacer-command)
![Last Commit](https://img.shields.io/github/last-commit/BenoitWauthier/cypress-placeholder-replacer-command)
![Contributors](https://img.shields.io/github/contributors/BenoitWauthier/cypress-placeholder-replacer-command)

A collection of two cypress commands :
- replacePlaceholders : provides the ability to replace placeholders within json object or string
- expectDeepEquals : provides the ability to expect two json objects (or string) to be tested as being "deeply" equal while optionally replacing placeholders within the "expected" item if a map with placeholders / values is provided

The replacePlaceholders can be (optionally) chained as child command of e.g. a fixture command
Internally it is using the [simple-placeholder-replacer](https://github.com/BenoitWauthier/simple-placeholder-replacer)

## Installation

To install with npm:

```
npm i cypress-placeholder-replacer-command --save
```

## Usage

Usage within Cypress:

```
import 'cypress-placeholder-replacer-command'

cy.replacePlaceholders("My name is {{myName}}", {myName: "Benoit Wauthier"})
cy.fixture("myfixutres/mynamefixture.json).replacePlaceholders({myName: "Benoit Wauthier"})
cy.expectDeepEquals(actual, expected)
cy.expectDeepEquals(actual, expected, {myName: "Benoit Wauthier"})

```

## Release

```
npm version major / minor / patch
git push origin ${tagName}

```

## License

This is licensed under an MIT License. [See details](LICENSE)

---
_Source: https://npm.io/package/cypress-placeholder-replacer-command · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
