-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set CSP on karma to prevent evalError regression #4706
Conversation
@juergba Do you have any idea? |
I just got this test from a helpful user: <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Security-Policy" content="script-src http: https: file: 'unsafe-inline'">
<link rel="stylesheet" href="https://unpkg.com/mocha@9.0.0/mocha.css" />
</head>
<body>
<div id="mocha"></div>
<!script src="https://unpkg.com/mocha@9.0.3/mocha.js"></script>
<script src="C:/Users/juerg/Desktop/mocha.js"></script>
<script>
mocha.setup('bdd');
it('works', () => {});
mocha.run();
</script>
</body>
</html> I don't know this karma configuration, I'm sorry. Can't you just include above test, without changing any karma configuration? |
Have you created a new browser bundle, after removing the devDependencies? |
@outsideris I guess you haven't removed the pinned versions correctly. |
Signed-off-by: Outsider <outsideris@gmail.com>
1a21cd7
to
60ddda6
Compare
I rebased this PR on current master including #4707 I passed browser tests. And I confirmed
|
Why don't you want to change karma configuration? |
Signed-off-by: Outsider <outsideris@gmail.com>
This karma config set CSP header for browser test to prevent evalError regression in future.
When I test it with mocha@8.3.0,
EvalError
occurred as I expected.And it is fine with the current master which is version-pinned devDependencies.
However, when I removed version-pinned devDependencies, it is passed as well. So, I'm not sure this config is correct to prevent evalError regression.