이 오류가 발생하기 시작했습니다. 테스트를 실행할 때 수정하지 못하는 것 같습니다.테스트를 실행할 때 예약어 'let'사용
09 04 2017 22:08:20.577:INFO [karma]: Karma v1.6.0 server started at http://0.0.0.0:9876/
09 04 2017 22:08:20.580:INFO [launcher]: Launching browser PhantomJS with unlimited concurrency
09 04 2017 22:08:20.602:INFO [launcher]: Starting browser PhantomJS
09 04 2017 22:08:23.661:INFO [PhantomJS 2.1.1 (Windows 8 0.0.0)]: Connected on socket SPM1D8Mj1w6ABbGuAAAA with id 7910462
PhantomJS 2.1.1 (Windows 8 0.0.0) ERROR
SyntaxError: Use of reserved word 'let' in strict mode
at test/browser/index.js:886
나는 특정 패키지를 업데이트하는 동안 이런 일이 발생했다고 생각합니다.
내 카르마의 설정은 다음과 같습니다
require('babel-register');
const webpack = require('../webpack.config.babel.js');
module.exports = function(config) {
config.set({
basePath: '../',
frameworks: ['mocha', 'chai-sinon'],
browsers: ['PhantomJS'],
files: ['test/browser/**/*.js'],
preprocessors: {
'test/**/*.js': ['webpack'],
'src/**/*.js': ['webpack']
},
webpack,
webpackMiddleware: { noInfo: true }
});
};
시험은 내가 심지어 대해 이야기하는 "하자"알 수
import { h, render, rerender } from 'preact';
import { route } from 'preact-router';
import App from '../../src/components/app';
/*global sinon,expect*/
describe('App',() => {
var scratch;
before(() => {
scratch = document.createElement('div');
(document.body || document.documentElement).appendChild(scratch);
});
beforeEach(() => {
scratch.innerHTML = '';
});
after(() => {
scratch.parentNode.removeChild(scratch);
});
describe('routing',() => {
it('should render the homepage',() => {
render(<App />, scratch);
expect(scratch.innerHTML).not.contain('Home');
});
it('should render the header',() => {
render(<App />, scratch);
expect(scratch.innerHTML).to.contain('header');
});
it('should render the footer',() => {
render(<App />, scratch);
expect(scratch.innerHTML).to.contain('footer');
});
it('should render the social media links',() => {
render(<App />, scratch);
expect(scratch.innerHTML).to.contain('a');
});
});
});
어떤 생각을 아주 간단하다?
나는이 문제를 해결할 수 있음 노드 v7.8.0
866 행의 test/browser/index.js 파일에 무엇이 있습니까? –
테스트가 실행되는 동안 어떻게 파일에 액세스 할 수 있는지 잘 모릅니다. – StevieB
해당 파일은 카르마 설정에 따라 이미 존재해야합니다. 저 디렉토리에 뭐가 들어 있니? –