Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Dave Ackerman
    @dmackerman
    my test:
    import angular from 'angular';
    import 'app/app.module';
    import 'angular-mocks';
    
    describe('App Controller', function() {
    
        let $scope;
        let $rootScope;
    
        // Load the module containing the app, only 'ng' is loaded by default.
        beforeEach(angular.mock.module('kickstartapp'));
    
        beforeEach(inject(function(_$rootScope_) {
            $rootScope = _$rootScope_;
            $scope = $rootScope.$new();
        }));
    
        describe('initial state', function() {
            expect(1 + 1).toBe(2);
        });
    
    });
    Jon Stevens
    @lookfirst
    You need to provide expect.
    ?
    Dave Ackerman
    @dmackerman
    oh.
    you don't do that in your example test?
    Jon Stevens
    @lookfirst
    yea, i just noticed that. hmmmm… what does your protractor config look like?
    oh wait, you’re trying to test e2e code with karma? can’t do that.
    you need to use protractor.
    Dave Ackerman
    @dmackerman
    this is a unit test.
    Jon Stevens
    @lookfirst
    nope. that is a e2e test.
    Dave Ackerman
    @dmackerman
    hmmm?
    Jon Stevens
    @lookfirst
    oh wow, today is my day to be dumb. =)
    Dave Ackerman
    @dmackerman
    heh. I'm just happy I got the scaffold to work today
    I get to work on this when I'm not swamped with bugs/features
    I migrated our entire architecture to ES6 modules, and there area bout 200 unit tests that are already writrten that need to be re-written, more than likely
    Jon Stevens
    @lookfirst
    good times.
    Dave Ackerman
    @dmackerman
    to me, it seems like jasmine isn't loaded properly?
    Jon Stevens
    @lookfirst
    can i see a gist of your karma conf?
    Jon Stevens
    @lookfirst
    a) you don’t need plugins: as anything that starts with karma- in your node_modules will load automatically.
    Dave Ackerman
    @dmackerman
    yeah. I think I have some issiue with that, but without plugins[] karma complains it can't load stuff.
    oh. i lied, again
    Jon Stevens
    @lookfirst
    what version of karma? it is working in my seed
    Dave Ackerman
    @dmackerman
    works with the local version in node_modules. duh
    yep. commented that part out :)
    still the same error
    Jon Stevens
    @lookfirst
    yea, only difference now is where you have your tests. not sure if that is part of the issue though.
    i definitely had a hard time getting all the paths setup correctly.
    took hours of fumbling.
    Dave Ackerman
    @dmackerman
    it's definitely loading the tests.
    the test*
    OH!
    you’re missing an it()
    Dave Ackerman
    @dmackerman
    oh, fuck my life
    Jon Stevens
    @lookfirst
    lol. we’re both dumb today. =)
    Dave Ackerman
    @dmackerman
    PASS
    wow. i am so happy right now.
    Jon Stevens
    @lookfirst
    :thumbsup:
    Dave Ackerman
    @dmackerman
    thanks dude.
    i owe you a beer.
    Jon Stevens
    @lookfirst
    :beers:
    Dave Ackerman
    @dmackerman
    now to go through all my specs and update them
    need much more coffee for that.
    panicbit
    @panicbit
    close
    Punita Ojha
    @punitaojha
    This message was deleted
    Ghost
    @ghost~59dff4f2d73408ce4f79ce02

    I am working on a personal angular 4 App. When I use the app without app-root, everything works. But as soon as I replace the content with <app-root> and modified app.component.html with the content, the CSS of the page is fucked up. Do you have an idea

    <head>
    <base href="/tool"/>
    <!-- Bunch of CSS files -->

    <link rel="icon" type="image/x-icon" href="favicon.ico"/>
    <!-- Polyfill(s) for older browsers -->
    <script src="node_modules/core-js/client/shim.min.js"></script>
    <script src="node_modules/zone.js/dist/zone.js"></script>
    <script src="node_modules/reflect-metadata/Reflect.js"></script>
    <script src="node_modules/systemjs/dist/system.src.js"></script>
    
    <script src="systemjs.config.js"></script>
    
    <!-- FreeWall : for the image tiling -->
    <script src="jquery-3.1.1.min.js"></script>
    
    <script>
        System.import('app').catch(function (err) {
            console.error(err);
        });
    </script>

    </head>

    <body>

    <app-root>Loading...</app-root>
    </body>
    </html>

    --app.component.ts
    import {Component} from '@angular/core';

    @Component({
      selector: 'app-root',
      templateUrl: './app.component.html',
      styleUrls: ['./app.component.css'],
      moduleId: module.id
    })
    export class AppComponent {
      title = 'app';
    }

    I have been searching for so long. Any help is welcome.