Code Monkey home page Code Monkey logo

ember-cli-test-loader's Introduction

Ember CLI Test Loader

Defines a TestLoader object that reviews all of the modules in requirejs.entries and loads those identified as tests.

TestLoader.prototype.shouldLoadModule can be overridden in order to customize the criteria for identifying test modules.

Usage

Within tests/test-helper.js:

  import TestLoader from 'ember-cli-test-loader/test-support';

  // optionally override TestLoader.prototype.shouldLoadModule

  TestLoader.load();


Note: 1.0.0 will move to package.json from bower.json, but that is not enabled yet. The default ember-cli blueprint specifies 0.2.2 which should definitely not allow 1.0.0. - [Link]

ember-cli-test-loader's People

Contributors

ankushdharkar avatar bushjumper avatar chadhietala avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar dgeb avatar ef4 avatar gitkrystan avatar marcioj avatar notmessenger avatar nullvoxpopuli avatar rwjblue avatar stefanpenner avatar trentmwillis avatar turbo87 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ember-cli-test-loader's Issues

Why was this extracted?

This seems silly to extract this single file into a separate npm package. Managing changes between this file for the notifications as well as the fixtures I'd like to add and ember-cli itself is going to be a major pain

Please make a new release

This is yet another package that keeps installing ember-cli-babel 6.x while the corresponding dependency update would already be in the repository.

The Broccoli Plugin: [Funnel: Funnel (testLoader)] failed

I get the following error on Windows with 1.0.0 and 1.1.0, it works fine with 0.2.2. It may be related to broccolijs/broccoli-funnel#53

The Broccoli Plugin: [Funnel: Funnel (testLoader)] failed with:
Error: ENOENT: no such file or directory, lstat 'E:\Michael\Workspace\stock.goodcity\bower_components\ember-cli-test-loader\test-loader.js'
  at Error (native)
  at Object.fs.lstatSync (fs.js:839:18)
  at Object.realpathSync (fs.js:1439:21)
  at symlinkWindows (E:\Michael\Workspace\stock.goodcity\node_modules\symlink-or-copy\index.js:87:26)
  at Function.symlinkOrCopySync [as sync] (E:\Michael\Workspace\stock.goodcity\node_modules\symlink-or-copy\index.js:56:5)
  at Funnel._copy (E:\Michael\Workspace\stock.goodcity\node_modules\broccoli-funnel\index.js:398:19)
  at Funnel.processFile (E:\Michael\Workspace\stock.goodcity\node_modules\broccoli-funnel\index.js:381:8)
  at Funnel.applyPatch [as _applyPatch] (E:\Michael\Workspace\stock.goodcity\node_modules\broccoli-funnel\index.js:298:12)
  at Funnel.<anonymous> (E:\Michael\Workspace\stock.goodcity\node_modules\broccoli-funnel\index.js:250:10)
  at Array.forEach (native)
  at Funnel.processFilters (E:\Michael\Workspace\stock.goodcity\node_modules\broccoli-funnel\index.js:249:9)
  at Funnel.build (E:\Michael\Workspace\stock.goodcity\node_modules\broccoli-funnel\index.js:172:10)
  at E:\Michael\Workspace\stock.goodcity\node_modules\broccoli-plugin\read_compat.js:61:34
  at lib$rsvp$$internal$$tryCatch (E:\Michael\Workspace\stock.goodcity\node_modules\rsvp\dist\rsvp.js:493:16)
  at lib$rsvp$$internal$$invokeCallback (E:\Michael\Workspace\stock.goodcity\node_modules\rsvp\dist\rsvp.js:505:17)
  at lib$rsvp$$internal$$publish (E:\Michael\Workspace\stock.goodcity\node_modules\rsvp\dist\rsvp.js:476:11)
  at lib$rsvp$asap$$flush (E:\Michael\Workspace\stock.goodcity\node_modules\rsvp\dist\rsvp.js:1198:9)
  at nextTickCallbackWith0Args (node.js:420:9)
  at process._tickCallback (node.js:349:13)


The broccoli plugin was instantiated at:
  at Funnel.Plugin (E:\Michael\Workspace\stock.goodcity\node_modules\broccoli-plugin\index.js:7:31)
  at new Funnel (E:\Michael\Workspace\stock.goodcity\node_modules\broccoli-funnel\index.js:44:10)
  at EmberApp.testFiles (E:\Michael\Workspace\stock.goodcity\node_modules\ember-cli\lib\broccoli\ember-app.js:1367:20)
  at EmberApp.test (E:\Michael\Workspace\stock.goodcity\node_modules\ember-cli\lib\broccoli\ember-app.js:1073:28)
  at EmberApp.toArray (E:\Michael\Workspace\stock.goodcity\node_modules\ember-cli\lib\broccoli\ember-app.js:1571:61)
  at EmberApp.toTree (E:\Michael\Workspace\stock.goodcity\node_modules\ember-cli\lib\broccoli\ember-app.js:1586:30)
  at module.exports (E:\Michael\Workspace\stock.goodcity\ember-cli-build.js:32:14)
  at Class.module.exports.Task.extend.setupBroccoliBuilder (E:\Michael\Workspace\stock.goodcity\node_modules\ember-cli\lib\models\builder.js:55:19)
  at Class.module.exports.Task.extend.init (E:\Michael\Workspace\stock.goodcity\node_modules\ember-cli\lib\models\builder.js:89:10)
  at new Class (E:\Michael\Workspace\stock.goodcity\node_modules\core-object\core-object.js:18:12)
  at Class.module.exports.Task.extend.run (E:\Michael\Workspace\stock.goodcity\node_modules\ember-cli\lib\tasks\serve.js:15:19)
  at E:\Michael\Workspace\stock.goodcity\node_modules\ember-cli\lib\commands\serve.js:64:24
  at lib$rsvp$$internal$$tryCatch (E:\Michael\Workspace\stock.goodcity\node_modules\rsvp\dist\rsvp.js:493:16)
  at lib$rsvp$$internal$$invokeCallback (E:\Michael\Workspace\stock.goodcity\node_modules\rsvp\dist\rsvp.js:505:17)
  at lib$rsvp$$internal$$publish (E:\Michael\Workspace\stock.goodcity\node_modules\rsvp\dist\rsvp.js:476:11)
  at lib$rsvp$asap$$flush (E:\Michael\Workspace\stock.goodcity\node_modules\rsvp\dist\rsvp.js:1198:9)
  at nextTickCallbackWith0Args (node.js:420:9)
  at process._tickCallback (node.js:349:13)

Where is the correct place to override TestLoader now?

Hey there :)

I'm attempting to upgrade to Ember 2.7.0 and beyond. One of the required changes is that the ember-cli-test-loader bower dependency has been replaced by this NPM-based one.

The README for this repo mentions overriding TestLoader as follows "Within your test suite" :

var TestLoader = require('ember-cli/test-loader')['default'];

That no longer works as expected, which makes sense. I was previously doing the override in tests/index.html - where should it be done now and what is the correct way to require/include the NPM based dependency?

I'd be happy to update the README once I get it working, with your guidance.

Thanks

README update please

I'm struggling to only run certain tests since upgrading to version 0.2.1. I've had some success when running tests in the browser by overriding loadModules or adding an include matcher function but this doesn't seem to work when running on the command line.

I see the README hasn't been updated for a year but the implementation was updated a couple of months ago - any chance you could please update the README or let me know the correct approach and I'll update it and add a PR? Is there a place other than tests/index.html in my ember-cli project that I should be defining the override or adding that matcher function for the inclusion/exclusion to run on the command line?

Thanks!

Changelog

Hi,

Could you add a CHANGELOG.md file with changes between versions and required migrations if any ?

Improve addon support

Since a lot of the Ember testing ecosystem relies on this addon, seems like there could be a bit better support behind it. In particular I feel like the following could be beneficial:

  • Document public/private APIs (everything appears public currently)
  • Add tests
  • ES6ify the code (it is using ES6 modules but everything else is ES3 or so)

If these seem desirable I can work on implementing them. Though I'd need a bit of guidance on the documentation front.

Does the "unable to require.unsee, please upgrade loader.js to >= v3.3.0" error refer to ember-cli/loader.js?

In an Ember CLI 1.13.8 addon, with

"ember-cli-test-loader": "ember-cli-test-loader#0.2.1",
"loader.js": "ember-cli/loader.js#3.3.0"

when accessing /tests this error is displayed due to https://github.com/ember-cli/ember-cli-test-loader/blob/master/test-loader.js#L72

Should it be? Seems I have the correct dependency but perhaps I'm not understanding the information/relationship correctly.

How do I use this to exclude a certain subdirectory from within /tests?

Hello,

I am trying to exclude a directory under tests that has non-ember tests run under selenium / casperjs for end-to-end testing. I'd like to keep it within the tests/ directory for semantics but I don't know how to exclude that path so that ember test doesn't try to load it and fail... How can I do that?

errror of me

Caught exception:

 Error: ENOENT: no such file or directory, lstat 'C:\a2\proj\typings\mai
    at Error (native)
    at Object.fs.lstatSync (fs.js:839:18)
    at Object.realpathSync (fs.js:1439:21)
    at C:\a2\proj\node_modules\ionic-gulp-browserify-typescript\node_mod
fy\index.js:58:38
    at Array.map (native)
    at DestroyableTransform.flush [as _flush](C:a2projnode_modulesi
p-browserify-typescriptnode_modulestsifyindex.js:58:6)
    at DestroyableTransform.<anonymous> (C:\a2\proj\node_modules\ionic-g
serify-typescript\node_modules\tsify\node_modules\through2\node_modules\
-stream\lib_stream_transform.js:115:49)
    at DestroyableTransform.g (events.js:260:16)
    at emitNone (events.js:67:13)
    at DestroyableTransform.emit (events.js:166:7)

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

`npm publish` for 1.1.1

I just fixed an issue (deprecation showing on latest ember-cli), and updated the version number / tagged but then realized I can't npm publish.

@stefanpenner - Can you add me to npm and/or publish?

Loading tests from pods

I'd like to keep pod specific tests within pods. Eg /app/modules/module1/tests /app/modules/module2/tests

There is a problem with the ember test helpers eg. visit, click, find etc..
They're working well but linting fails reporting the functions are not defined.

I've tried adding .jshintrc to the pod eg. /app/modules/module1/tests/.jshintrc
I've tried importing the test helpers into tests manually eg. import { find, click, etc.. } from 'ember/different-places'
None of these works.

Am I missing something or is it completely not supported?

What should happen when failure to load a module?

Currently, when requiring a test file, if an error gets throw, the error is logged by console.error() and the test-loader will continue to require the next test file.
See https://github.com/ember-cli/ember-cli-test-loader/blob/master/addon-test-support/index.js#L71

This effectively ignores all the tests that are part of the test file that did not get required, which would cause unexpected missing test coverage.

Was interested in knowing what is the rational in the choice of the current implementation.
@rwjblue would you have some context on this?

License

Can you please add a license file to this project?

v1.0.0 vs v0.2.2

I currently have "ember-cli-test-loader": "0.2.2" in my bower.json. Whenever I run an update for bower packages, it is always updated to 1.0.0 which throws error messages on running ember server.

Should we remove it from bower.json and install it as an ember addon, or should we refrain from using 1.0.0 until further notice?

I am a little confused because in the releases, it says that 0.2.2 is the current release.

Would appreciate your help. Thanks

Add a License File?

Just wondering whether this package is covered under MIT license. If so, would you mind adding a license file?

Thanks!

add similar jscs functionality if detected

Do you think it would be possible to add a "Disable JSCS" check box next to the "Disable JSHint" check box if jscs/broccoli-jscs is detected? I will do the research/pull-requests if you think it would be a suitable addition.

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.