Giter VIP home page Giter VIP logo

snapdragon's People

Contributors

drewdeponte avatar gfmtim avatar jwreachlocal avatar prasadc82 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

snapdragon's Issues

snapdragon - running from command prompt

Hello,

I have my specs inside spec/javascript/ folder and while running from command prompt as - snapdragon spec/javascript/
It fails all test cases. (Note forward slash at the end)

But same works if I don't use '/' at last or put '*' at the end.

Thanks.

Replace SpecFile.spec_query_param with an actual parser

To allow for the inevitable variance that will exist in spec files, the build_jspec_filter should be replaced with a parser that will recurse through the spec files and accurately determine describe and it blocks with line numbers.

Make the directory snapdragon is run from (generally project root dir) is available via /:path in web_application.rb

This is especially valuable in the following scenario:

  1. You have your Jasmine spec files in spec/javascripts/.
  2. You have your Fixtures stored in spec/fixtures
  3. You have a Jasmine spec that needs access to a Fixture located in spec/fixtures

I am sure there are other scenarios where the Jasmine specs may need to access various paths and using the current working directory of the snapdragon process allows us to avoid requiring a configuration files which specifies the root of the project.

In the future we may decided that we want to use the current working directory of the snapdragon process as the default and allow this to be overridden with some sort of configuration.

Syntax errors blow up without line information

Would be nice if it outputted file and line information for the syntax error.

/usr/local/rvm/gems/ruby-2.0.0-p247@budget_builder/gems/poltergeist-1.3.0/lib/capybara/poltergeist/browser.rb:229:in `command': One or more errors were raised in the Javascript code on the page. If you don't care about these errors, you can ignore them by setting js_errors: false in your Poltergeist configuration (see documentation for details). (Capybara::Poltergeist::JavascriptError)

SyntaxError: Parse error
    from /usr/local/rvm/gems/ruby-2.0.0-p247@budget_builder/gems/poltergeist-1.3.0/lib/capybara/poltergeist/browser.rb:29:in `visit'
    from /usr/local/rvm/gems/ruby-2.0.0-p247@budget_builder/gems/poltergeist-1.3.0/lib/capybara/poltergeist/driver.rb:89:in `visit'
    from /usr/local/rvm/gems/ruby-2.0.0-p247@budget_builder/gems/capybara-2.1.0/lib/capybara/session.rb:193:in `visit'
    from /usr/local/rvm/gems/ruby-2.0.0-p247@budget_builder/gems/snapdragon-1.0.0/lib/snapdragon/cli_application.rb:25:in `run'

Make it so that files required by require_relative directives can themselves have require_relative() directives.

The most common use case where this is going to be very important is when you have a situation where you need to control order of requirements across multiple tests files.

In this scenario you would simply want a spec_helper.js file that would have all of your require_relative() directives in it, in the correct order. Plus you could have any other setup js in the spec_helper.js.

Then your actual spec files would only have to require_relative the spec_helper.js and all the order issues could be controlled in a singular place. This very much follows the rspec model.

Make Capybara.default_wait_time configurable

# Set the default_wait_time to something reasonable for the entire length of
# the test suite to run. This should probably eventually be something
# configurable because these could break for people with long running test
# suites.
Capybara.default_wait_time = 120 # 2 mins

relative paths outside the root do not get loaded into the context

discovered this trying to work around #31 if you load a relative url outside the repository it will not say file not found but when it executes your spec the variables that are defined in that file are not available to you. Example:

// require_relative('../../../../../usr/local/rvm/gems/ruby-2.0.0-p247@proposal_tool/gems/rails-assets-angular-1.2.8/vendor/assets/javascripts/angular/angular.js')

Every spec says ReferenceError: Can't find variable: angular despite the path being correct.

Add ability to pass pattern for loading of spec files

Implement feature similar to --pattern flag in rspec to set a pattern for loading spec files from a location:
-P, --pattern PATTERN Load files matching pattern (default: "spec/*_/__spec.rb").

Make default pattern spec/*_/__spec.js

Some require files show up twice in the runner when they should only show up once

I looked into it a bit and it seems this is happening because the Set which makes sure unique path strings only exist once in the set, users can specify the same path in multiple ways. For example the following map to the same path in the end but their path strings are different:

// require_relative('src/hoopty.js')
// require_relative('./src/hoopty.js')

Because the path strings differ the Set doesn't identify them as being the same. I think the ideal solution would be if we could collapse the paths down to the most basic form that represents the path before it gets added to the Set. That way even if they start out different as long as they represent the same actual path they only get included once.

Provide the ability to load assets from gem files

The use case we are looking at is certain javascript files are provided to us through gems. We can include these files in our deployed application via the //= require directive but its unclear how to test code that depends on this code from snapdragon without knowing the exact path the gem is sitting in the filesystem.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.