You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Test.ts 716B

12345678910111213141516171819202122
  1. import { Injector } from '../../src/Injector'
  2. import { TestComponent } from './TestComponent'
  3. import { assert, expect } from 'chai';
  4. import { COMPONENT_A_VALUE, COMPONENT_B_VALUE } from '../CONSTANTS';
  5. var should = require('chai').should();
  6. var chai = require("chai");
  7. var chaiAsPromised = require("chai-as-promised");
  8. chai.use(chaiAsPromised);
  9. describe('dependjs', () => {
  10. it('is able to resolve linear dependencies', () => {
  11. const testComp = Injector.resolve(TestComponent)
  12. expect(testComp.getFromA()).to.be.equal(COMPONENT_A_VALUE)
  13. expect(testComp.getAThroughB()).to.be.equal(COMPONENT_A_VALUE)
  14. expect(testComp.getFromB()).to.be.equal(COMPONENT_B_VALUE)
  15. })
  16. })