Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

marocchino

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

marocchino

A utility for running sandboxed DOM tests in browser tests.

  • 0.1.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

marocchino

A tool for running client-side tests in a sandboxed environment. You execute your tests with your normal testing framework but can execute code and tests within a sandboxed iframe. This allows you to safely run DOM tests without affecting any other tests.

Simple example

sandbox = null

beforeEach ->
    sandbox = marocchino.create({
        src: '/base/test/blank.html'
    })

afterEach ->
    marocchino.remove sandbox

it 'should be able to execute functions inside the iframe', ->
    sandbox.run( ->
        window._testValue = "appcues"
    ).then ->
        expect(sandbox.iframe.contentWindow._testValue).to.equal "appcues"

Full example

See the tests for this library in the test/ directory for a full example using karma, mocha and chai.

Building

  1. Run npm install.
  2. Run grunt. This will build the library file and run the tests in PhantomJS, Chrome and Firefox.
  3. The built file should be in the lib/ directory.

Usage

  1. Get the lib/marocchino.js loaded on your test page.
  2. Create a new sandbox with marocchino.create().
  3. Execute code in the sandbox by using the sandbox.run(func) call.

Keywords

FAQs

Package last updated on 23 Oct 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