Closed
Description
I've given up with imports/requires, so I am trying the script-tag way.
in src/index.html:
{{#unless environment.production}}
<!-- These two files (used for testing) cannot be included the 'normal' way,
because angular-cli's build tools don't resolve dependencies of 3rd party libs. -->
<script src="/dist/vendor/sinon/pkg/sinon.js" type="text/javascript"></script>
<script src="/dist/vendor/axios/dist/axios.js" type="text/javascript"></script>
{{/unless}}
</head>
and in angular-cli-build.js:
vendorNpmFiles: [
...
'sinon/**/*.js',
],
and then in my test:
declare var sinon:any;
...
beforeEach(() => sandbox = sinon.sandbox.create());
I get the error:
ReferenceError: sinon is not defined
$ ng --version
angular-cli: 1.0.0-beta.6
node: 5.10.1
os: linux x64
how do I use the library?
after running ng test
, there are 0 console errors in the opened chrome window. The errors are only in the terminal.