Skip to content

Instantly share code, notes, and snippets.

@schalkneethling
Last active August 29, 2015 14:23
Show Gist options
  • Select an option

  • Save schalkneethling/9817378849b025d01c45 to your computer and use it in GitHub Desktop.

Select an option

Save schalkneethling/9817378849b025d01c45 to your computer and use it in GitHub Desktop.

Revisions

  1. Schalk Neethling revised this gist Jul 19, 2015. 1 changed file with 0 additions and 15 deletions.
    15 changes: 0 additions & 15 deletions casperjs-snippets.cson
    Original file line number Diff line number Diff line change
    @@ -1,18 +1,3 @@
    # Your snippets
    #
    # Atom snippets allow you to enter a simple prefix in the editor and hit tab to
    # expand the prefix into a larger code block with templated values.
    #
    # You can create a new snippet in this file by typing "snip" and then hitting
    # tab.
    #
    # An example CoffeeScript snippet to expand log to console.log:
    #
    # '.source.coffee':
    # 'Console log':
    # 'prefix': 'log'
    # 'body': 'console.log $1'
    #
    ".source.js":
    "Casperjs Skeleton":
    "prefix": "casper-init"
  2. Schalk Neethling revised this gist Jul 19, 2015. 1 changed file with 15 additions and 2 deletions.
    17 changes: 15 additions & 2 deletions casperjs-snippets.cson
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,18 @@
    # Your snippets
    #
    # Atom snippets allow you to enter a simple prefix in the editor and hit tab to
    # expand the prefix into a larger code block with templated values.
    #
    # You can create a new snippet in this file by typing "snip" and then hitting
    # tab.
    #
    # An example CoffeeScript snippet to expand log to console.log:
    #
    # '.source.coffee':
    # 'Console log':
    # 'prefix': 'log'
    # 'body': 'console.log $1'
    #
    ".source.js":
    "Casperjs Skeleton":
    "prefix": "casper-init"
    @@ -25,8 +40,6 @@
    });
    });
    """

    ".source.js":
    "Casperjs Begin Block":
    "prefix": "casper-begin"
    "body": """
  3. Schalk Neethling created this gist Jun 29, 2015.
    43 changes: 43 additions & 0 deletions casperjs-snippets.cson
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,43 @@
    ".source.js":
    "Casperjs Skeleton":
    "prefix": "casper-init"
    "body": """
    /* This Source Code Form is subject to the terms of the Mozilla Public" + '/n' +
    "* License, v. 2.0. If a copy of the MPL was not distributed with this
    * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
    /* global casper */
    'use strict';
    var config = require('../lib/config');
    var helpers = require('../lib/helpers');
    var path = '/firefox/sync/';
    var url = config.base() + path;
    casper.test.begin('Firefox Sync, Elements: ' + url, 1, function suite(test) {
    casper.start(url, function() {
    test.assertHttpStatus(200);
    });
    casper.run(function() {
    test.done();
    helpers.done();
    });
    });
    """

    ".source.js":
    "Casperjs Begin Block":
    "prefix": "casper-begin"
    "body": """
    casper.test.begin('$1' + url, 1, function suite(test) {
    casper.start(url, function() {
    $2
    });
    casper.run(function() {
    test.done();
    helpers.done();
    });
    });
    """