Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 16 02:44
    greenkeeper[bot] commented #1134
  • Oct 16 02:44

    greenkeeper[bot] on chokidar-3.2.2

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

  • Oct 15 14:19
    greenkeeper[bot] commented #1137
  • Oct 15 14:19

    greenkeeper[bot] on terser-4.3.9

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

  • Oct 09 11:10
    m-mujica commented #1509
  • Oct 09 03:45
    MarcGodard commented #1509
  • Oct 09 03:24
    MarcGodard commented #1509
  • Oct 08 20:31
    m-mujica closed #1509
  • Oct 08 20:31
    m-mujica commented #1509
  • Oct 07 22:06
    MarcGodard commented #1509
  • Oct 07 16:31
    matthewp commented #1509
  • Oct 07 16:12
    nlundquist edited #1509
  • Oct 07 16:06
    nlundquist edited #1509
  • Oct 07 16:06
    nlundquist opened #1509
  • Oct 07 16:06
    nlundquist labeled #1509
  • Oct 07 15:01
    m-mujica commented #1504
  • Oct 07 15:01
    m-mujica commented #1504
  • Oct 07 01:07
    greenkeeper[bot] commented #1115
  • Oct 07 01:06

    greenkeeper[bot] on yargs-14.2.0

    fix(package): update yargs to v… (compare)

  • Oct 05 22:46
    greenkeeper[bot] commented #1137
Chasen Le Hara
@chasenlehara
@xedoken, @matthewp can correct me if I’m wrong, but I think that’s a high priority issue for the Steal 1.0 release, it just hasn’t been fixed yet.
Matthew Phillips
@matthewp
I'm not sure what issue we're referring to
Is there an issue number?
xedos
@xedoken
Hi, nope. I did not create an issue in github yet, in a few hours i will do that. The problem is about incorrect bundling with new steal and steal tools. May be i'm wrong,but none of the build and exports was success. So after building i try to load that bundles in local html, and it fails because of less engine. If i export as standalone, fails, if global fails too. May be you can writean instructions how i need to write a build.js to correct building and exporting with steal, steal-tools, and steal-less/css?
Sunil George
@georgesunil81
Hello! I need help running Karma with StealJS. I am getting an error where Karma is not able to find stealconfig.js and dev.js. But, my StealJS application is able to find these files!
Any ideas?
Kevin Phillips
@phillipskevin
Sunil George
@georgesunil81
Ah! thanks @phillipskevin . I will check it out now.
@phillipskevin , I see you have included 'node_modules/steal/steal.js' in the karma.conf.js but there is a pattern above that includes it already, do we have to include steal.js twice?
I am trying the same in my project now to see if it resolves the issue I am facing!
Kevin Phillips
@phillipskevin
the pattern is included: false
so yeah, that could be why yours can’t load dev.js if you don’t have a pattern like that
Sunil George
@georgesunil81
Okay. I am still getting the error in the Karma console. It is not able to find stealconfig and dev.js!
Here is my karma.conf.js -
module.exports = function(config) {
  config.set({
    basePath: '',
    frameworks: ['jasmine'],
    files: [
      { pattern: 'test/**/*.js', included: false },
      { pattern: 'node_modules/steal/**/*.js', included: false },
      { pattern: 'node_modules/**/package.json', included: false },
      { pattern: 'package.json', included: false },
      'node_modules/steal/steal.js',
      'karma.bootstrap.js'
    ],
    exclude: [ ],
    preprocessors: { },
    reporters: ['dots'],
    port: 9876,
    colors: true,
    logLevel: config.LOG_INFO,
    autoWatch: true,
    browsers: ['Chrome'],
    singleRun: false,
    concurrency: Infinity
  })
};
And here is my karma.bootstrap.js
window.__karma__.loaded = function() {
  var s = document.createElement('script');
  s.setAttribute('src', 'base/node_modules/steal/steal.js');
  s.setAttribute('data-main', 'test/');
  document.head.appendChild(s);

  s.onload = function () {
    steal.done().then(function(){
        console.log('----- StealJS is loaded -----');
      if(window.__karma__) {
        window.__karma__.start();
      }
    });
  };
};
The errors are coming from karma.bootstrap.js. It is not able to find stealconfig.js and dev.js.
Kevin Phillips
@phillipskevin
you probably need a pattern for your stealconfig
Sunil George
@georgesunil81
But, I already have the following pattern in the karma.conf.js
{ pattern: 'node_modules/steal/**/*.js', included: false },
Would it not include stealconfig.js and dev.js too?
Kevin Phillips
@phillipskevin
where is stealconfig?
Sunil George
@georgesunil81
stealconfig is in "node_modules/steal" directory.
Kevin Phillips
@phillipskevin
also, why do you need to use document.head.appendChild to inject steal?
isn’t karma doing that already?
Sunil George
@georgesunil81
Oh! Earlier I did not have the following line in my karma.config.js
Kevin Phillips
@phillipskevin
try setting it up how it is in the forum post
Sunil George
@georgesunil81
'node_modules/steal/steal.js',
Sure, I will try that now.
Made the changes. Now running it again...
Hmmm @phillipskevin . Making it mirror what you have in the forum resolved the 404/stealconfig.js and 404/dev.js errors.
I am getting bunch of different errors now.
Thanks @phillipskevin for your help resolving the 404s. I will troubleshoot the new errors further. Will let you know if I need help.
Sunil George
@georgesunil81
Thanks @phillipskevin . It now executed a very simple test as below which I added within my CanJS-StealJS application project directory structure -
```
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’);