I'm studying how to use KarmaJS.
My question is how can I expose private functions and variables for my test suite?
I'm already attaching my privates to window.__testing__
but its not appearing in my test suite.
I want to try to test DOM events that's why I'm adding src/main.html
in karma.conf.js files array
.
I'm sure I'm doing something wrong here. Thanks in advance.
Folder Structure
node_modules
src
|- main.css
|- main.html
|- main.js
tests
|- main.js
gulpfile.js
karma.conf.js
package.json
yarn.lock
Karma Config
.
.
.
frameworks: ['mocha'],
files: [
'node_modules/chai/chai.js',
'src/*.html',
'tests/*.js'
],
Main HTML
<head>
<link rel="stylesheet" href="main.css">
</head>
<body>
.
.
.
<script src="main.js"></script>
</body>
Aucun commentaire:
Enregistrer un commentaire