New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

eminent

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eminent

A DOM assertions library with Emmet syntax for JavaScript testing

  • 0.0.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Eminent

Build Status

Eminent is a DOM assertions library with Emmet syntax for JavaScript testing.

let html = `
  <table>
    <tbody>
      <tr>
        <td>Eminent</td>
        <td>is</td>
        <td>awesome</td>
      </tr>
    </tbody>
  </table>
`

eminent.domIsLike(html, 'table>tbody>tr>td*3')

Installation

$ npm install eminent

API Reference

eminent.domIs(dom, abbr)

Strictly compare DOM to Emmet abbreviation.

Kind: static method of eminent
Throws:

  • exception When DOM does not strictly match the Emmet abbreviation
ParamTypeDescription
domstringDOM string
abbrstringEmmet abbreviation to compare to

Example

import * as eminent from 'eminent'

let html = '<div id="header"><div class="logo">Company</div></div>'

eminent.domIs(html, 'div#header>div.logo{Company}')

eminent.domIsLike(dom, abbr)

Compare DOM to Emmet abbreviation. Ignores whitespace, attributes and content.

Kind: static method of eminent
Throws:

  • exception When DOM does not loosely match the Emmet abbreviation
ParamTypeDescription
domstringDOM string
abbrstringEmmet abbreviation to compare to

Example

import * as eminent from 'eminent'

let html = `
    <div id="header">
        <div class="logo">
            Company
        </div>
    </div>
`

eminent.domIsLike(html, 'div>div')

eminent.domAttrsIs(dom, abbr)

Compare DOM to Emmet abbreviation, including attribute names and values. Ignores whitespace and content.

Kind: static method of eminent
Throws:

  • exception When DOM does not loosely match the Emmet abbreviation, including attribute names and values.
ParamTypeDescription
domstringDOM string
abbrstringEmmet abbreviation to compare to

Example

import * as eminent from 'eminent'

let html = `
    <div id="header">
        <div class="logo">
            Company
        </div>
    </div>
`

eminent.domAttrsIs(html, 'div#header>div.logo')

eminent.domAttrsIsLike(dom, abbr)

Compare DOM to Emmet abbreviation, including attribute names. Ignores whitespace, attribute values and content.

Kind: static method of eminent
Throws:

  • exception When DOM does not loosely match the Emmet abbreviation, including attribute names.
ParamTypeDescription
domstringDOM string
abbrstringEmmet abbreviation to compare to

Example

import * as eminent from 'eminent'

let html = `
    <div id="header">
        <div class="logo">
            Company
        </div>
    </div>
`

eminent.domAttrsIsLike(html, 'div#id>div.class')

eminent.domContentIs(dom, abbr)

Compare DOM to Emmet abbreviation, including content. Ignores whitespace and attributes.

Kind: static method of eminent
Throws:

  • exception When DOM does not loosely match the Emmet abbreviation, including content.
ParamTypeDescription
domstringDOM string
abbrstringEmmet abbreviation to compare to

Example

import * as eminent from 'eminent'

let html = `
    <div id="header">
        <div class="logo">
            Company
        </div>
    </div>
`

eminent.domContentIs(html, 'div#header>div.logo{Company}')

Keywords

FAQs

Package last updated on 03 Nov 2015

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc