Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 19 18:31
    greenkeeper[bot] commented #1134
  • Sep 19 18:31

    greenkeeper[bot] on chokidar-3.1.1

    fix(package): update chokidar t… (compare)

  • Sep 16 19:11
    greenkeeper[bot] commented #1134
  • Sep 16 19:10

    greenkeeper[bot] on chokidar-3.1.0

    fix(package): update chokidar t… (compare)

  • Sep 09 14:16
    greenkeeper[bot] commented #1137
  • Sep 09 14:16

    greenkeeper[bot] on terser-4.3.1

    fix(package): update terser to … (compare)

  • Sep 07 20:23
    greenkeeper[bot] commented #1137
  • Sep 07 20:23

    greenkeeper[bot] on terser-4.3.0

    fix(package): update terser to … (compare)

  • Sep 05 15:38

    greenkeeper[bot] on steal-2.2.3

    (compare)

  • Sep 05 15:34

    greenkeeper[bot] on steal-2.2.3

    chore(package): update steal to… (compare)

  • Sep 05 14:59

    matthewp on v2.2.3

    (compare)

  • Sep 05 14:59

    matthewp on master

    2.2.3 (compare)

  • Sep 05 14:38

    matthewp on main-forward-slash

    (compare)

  • Sep 05 14:38

    matthewp on master

    Support the forward slash behav… Merge pull request #1508 from s… (compare)

  • Sep 05 14:38
    matthewp closed #1508
  • Sep 05 14:38
    matthewp closed #1507
  • Sep 05 13:00
    matthewp opened #1508
  • Sep 05 13:00

    matthewp on main-forward-slash

    Support the forward slash behav… (compare)

  • Sep 04 21:26
    chasenlehara labeled #1507
  • Sep 04 21:26
    chasenlehara opened #1507
Sunil George
@georgesunil81
describe('Sample Test', function () {
  it('test', function () {
    expect(true).toBeTruthy();
  });
});
Now, I will be going into testing the actual application logic. Since StealJS is now succesfully loaded, I believe I should be able to just import my app modules into my tests and run specific functions from in there.
Will try it out.
Sunil George
@georgesunil81
@phillipskevin , are there any examples of testing CanJS Controllers with Karma-Jasmine. My application pages are rendered using Can.Control.
Sunil George
@georgesunil81
From my unit tests, I am trying to invoke specific functions from within my controller.
If you have any examples of it or have a link to, let me know once you get a chance. Thanks in advance for all your help.
Kevin Phillips
@phillipskevin
I’m not sure what you mean
I don’t think there is anything Karma or Jasmine specific about it
probably need some more info on what you’re trying to test, but basically you just need to create an instance of the Control and call the function
var c = new MyControl(el, data);
c.myFunction();
expect(data.whatever).toBe(something);
obviously that assertion totally depends on what it is you’re trying to test
Sunil George
@georgesunil81
Thanks @phillipskevin . That gives me a good hint on how to proceed. What will be el? I suppose it will be the DOM element that the application controller would render into. I think I will need to use jasmine-fixture to add the element in memory/DOM first and then instantiate the controller in my test on that element.
Kevin Phillips
@phillipskevin
if you’re not going to check what is happening in the dom it can be anything
document.createElement(‘div’);
or even if you are
Sunil George
@georgesunil81
Hmmm...yes, thats true. Thanks @phillipskevin . This gives me enough directions for the day. I will let you know if I run into any issues.
Thanks again for all your help.
Kevin Phillips
@phillipskevin
:thumbsup:
Matthew Phillips
@matthewp
Kevin Phillips
@phillipskevin
@matthewp should it be
"steal": {
  "plugins": [
instead of "system"
xedos
@xedoken

Hi guys! Does anyone know what the issue is with can-route in donejs:

Cannot define property:page, object is not extensible ( in can-define).

"can-define": "^1.0.4",
"can-route": "^3.0.5",
"can-route-pushstate": "^3.0.1",
"steal": "^0.16.43",
"steal-tools": "^0.16.8"

Matthew Phillips
@matthewp
sounds like a canjs issue. That problem is caused by not defining a property, most likely your main ViewModel needs a page: "string" to be defined on it.
xedos
@xedoken
Yeap, already fixed. B/c new can3 need the page property in app.js :)
Paul Tichonczuk
@tracer99
So In my main app, I have node-modules loading from just the name (like in DoneJS). So I can import moment and it will find it in node-modules/moment
However, in my unit tests, this doesn't work. Doesn't steal look into package.json in the root of the project like it does for the main app? Do I have to specify it somehow?
Kevin Phillips
@phillipskevin
how are you loading steal in your unit tests?
if you’re loading steal from node_modules, then it should read the package.json
Paul Tichonczuk
@tracer99
<script src="../../../node_modules/steal/steal.js" main="ucp2/dashboard/pin/pin_test" data-mocha="bdd"></script>
Kevin Phillips
@phillipskevin
what happens when you try to import moment in your tests?
Paul Tichonczuk
@tracer99
cannot find /moment.js
first import is actually steal-mocha which yields a similar error
Paul Tichonczuk
@tracer99
The only thing I can think of, is that our projects sits within a larger project (not noad related).... so the root of the site is htdocs/static/ not / in the project directory structure (The webserver is configured to treat htdocts/static/ as the root of the site, I'm just refereing to the project directory structure).
Kevin Phillips
@phillipskevin
are you setting System.baseURL?
Paul Tichonczuk
@tracer99
No. but the base URL is / I'm just talking about the underlining directory structure. / in the browser points to htdocts/static in the project. package.json and node_modules are there as well.
Kevin Phillips
@phillipskevin
oh, ok
Paul Tichonczuk
@tracer99
I checked, the main projects package.json is being loaded
Kevin Phillips
@phillipskevin
when you run your tests you mean?
Paul Tichonczuk
@tracer99
yes
Kevin Phillips
@phillipskevin
Try to compare the System object between your main app and the test page
System.configMain, System.baseURL, System.npm, System.meta, System.paths
Paul Tichonczuk
@tracer99
will do
Paul Tichonczuk
@tracer99
@phillipskevin they are the same
Kevin Phillips
@phillipskevin
ok, is it possible to push a simplified version of your project somewhere I can take a look?
Paul Tichonczuk
@tracer99
hah. not easily. I'll try to reproduce it using a similar structure and see where I get.
Nico R.
@nriesco
has anyone had trouble with the generated css file after doing a donejs deploy?
I’m working on it but it seems that if I add a custom template something weird happens and the browser won’t render things correctly. That or the generated css file has errors
Anyway I sort of fixed it by including comments at the beggining and end of this custom css but like this: /*! my comment */
with css file I mean /dist/bundles/my-app/index.css
Nico R.
@nriesco
I just couldn’t replicate the error I had. I guess it had something to do with bootstrap, it was included in a plugin as well as the main app, I updated the plugin not to include bootstrap, probably that helped.
Paul Tichonczuk
@tracer99
@phillipskevin ok. I've created a sample app that exhibits the bug I'm talking about. details in README https://github.com/tracer99/node-import