Error output is minified
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- typescript, webpack
- Lĩnh vực
- testing-qa
Hướng nghiên cứu
Bắt đầu với test-config/karma.conf.js, test-config/webpack.test.js và test-config/karma-test-shim.js, sau đó chạy thiết lập kiểm thử Ionic để tái hiện đầu ra lỗi đã minify. Truy vết cách các source map của webpack và Karma preprocessor được cấu hình, đồng thời xác minh rằng các kiểm thử thất bại báo cáo vị trí mã nguồn có thể đọc được thay vì chỉ có karma-test-shim.js.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
As recommended in the readme I have follow this tutorial to integrate tests to my Ionic Project. It works but when I have an error the code showed is minified and of course it is hard to know what is wrong.
For example:
Spec File
import { TestBed } from "@angular/core/testing";
import { StatisticsProvider } from "./statistics.service";
describe("StatisticsProvider", () => {
let service: StatisticsProvider;
beforeEach(() => {
TestBed.configureTestingModule({
providers: [StatisticsProvider]
});
service = TestBed.get(StatisticsProvider);
});
it("can load instance", () => {
expect(service).toBeTruthy();
});
});
Output Error:
Error: StaticInjectorError(e)[e -> e]:
StaticInjectorError(Platform: core)[e -> e]:
NullInjectorError: No provider for e!
error properties: Object({ ngTempTokenPath: null, ngTokenPath: [ 'e', Function ] })
Error: StaticInjectorError(e)[e -> e]:
StaticInjectorError(Platform: core)[e -> e]:
NullInjectorError: No provider for e!
at e.get (http://localhost:9876/base/test-config/karma-test-shim.js:45:135)
at http://localhost:9876/base/test-config/karma-test-shim.js:52:2430
at le (http://localhost:9876/base/test-config/karma-test-shim.js:52:2448)
at e.get (http://localhost:9876/base/test-config/karma-test-shim.js:52:1612)
at http://localhost:9876/base/test-config/karma-test-shim.js:52:2430
at le (http://localhost:9876/base/test-config/karma-test-shim.js:52:2448)
at e.get (http://localhost:9876/base/test-config/karma-test-shim.js:52:1612)
at oi (http://localhost:9876/base/test-config/karma-test-shim.js:298:681)
at http://localhost:9876/base/test-config/karma-test-shim.js:298:869
at si (http://localhost:9876/base/test-config/karma-test-shim.js:298:1053)
at oi (http://localhost:9876/base/test-config/karma-test-shim.js:298:639)
at e.get (http://localhost:9876/base/test-config/karma-test-shim.js:313:9035)
at e.get (http://localhost:9876/base/test-config/karma-test-shim.js:471:6725)
at Function.e.get (http://localhost:9876/base/test-config/karma-test-shim.js:471:2525)
at UserContext.<anonymous> (http://localhost:9876/base/test-config/karma-test-shim.js:702:99461)
at e.invoke (http://localhost:9876/base/test-config/karma-test-shim.js:514:7001)
at e.onInvoke (http://localhost:9876/base/test-config/karma-test-shim.js:618:2261)
at e.invoke (http://localhost:9876/base/test-config/karma-test-shim.js:514:6941)
at t.run (http://localhost:9876/base/test-config/karma-test-shim.js:514:2171)
at l (http://localhost:9876/base/test-config/karma-test-shim.js:656:1318)
at UserContext.<anonymous> (http://localhost:9876/base/test-config/karma-test-shim.js:656:1428)
at <Jasmine>
at e.invokeTask (http://localhost:9876/base/test-config/karma-test-shim.js:514:7685)
at t.runTask (http://localhost:9876/base/test-config/karma-test-shim.js:514:2865)
at m (http://localhost:9876/base/test-config/karma-test-shim.js:514:9934)
./test-config/karma.conf.js
var webpackConfig = require('./webpack.test.js');
module.exports = function (config) {
var _config = {
basePath: '../',
frameworks: ['jasmine'],
files: [
'./test-config/ssd-refresh-debug.js',
{
pattern: './test-config/karma-test-shim.js',
watched: true
},
{
pattern: './src/assets/**/*',
watched: false,
included: false,
served: true,
nocache: false
}
],
proxies: {
'/assets/': '/base/src/assets/'
},
preprocessors: {
'./test-config/karma-test-shim.js': ['webpack', 'sourcemap']
},
webpack: webpackConfig,
webpackMiddleware: {
stats: 'errors-only'
},
webpackServer: {
noInfo: true
},
browserConsoleLogOptions: {
level: 'log',
format: '%b %T: %m',
terminal: true
},
coverageIstanbulReporter: {
reports: ['html', 'lcovonly'],
fixWebpackSourcePaths: true
},
reporters: config.coverage ? ['kjhtml', 'dots', 'coverage-istanbul'] : ['kjhtml', 'dots'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
};
config.set(_config);
};
./test-config/webpack.test.js
var webpack = require('webpack');
var path = require('path');
module.exports = {
devtool: 'inline-source-map',
resolve: {
extensions: ['.ts', '.js']
},
module: {
rules: [{
test: /\.ts$/,
loaders: [{
loader: 'ts-loader'
}, 'angular2-template-loader']
},
{
test: /.+\.ts$/,
exclude: /(index.ts|mocks.ts|\.spec\.ts$)/,
loader: 'istanbul-instrumenter-loader',
enforce: 'post',
query: {
esModules: true
}
},
{
test: /\.html$/,
loader: 'html-loader?attrs=false'
},
{
test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
loader: 'null-loader'
}
]
},
plugins: [
new webpack.ContextReplacementPlugin(
// The (\\|\/) piece accounts for path separators in *nix and Windows
/(ionic-angular)|(angular(\\|\/)core(\\|\/)@angular)/,
root('./src'), // location of your src
{} // a map of your routes
)
]
};
function root(localPath) {
return path.resolve(__dirname, localPath);
}
./test-config/karma-test-shim.js
Error.stackTraceLimit = Infinity;
require('core-js/es6');
require('core-js/es7/reflect');
require('zone.js/dist/zone');
require('zone.js/dist/long-stack-trace-zone');
require('zone.js/dist/proxy');
require('zone.js/dist/sync-test');
require('zone.js/dist/jasmine-patch');
require('zone.js/dist/async-test');
require('zone.js/dist/fake-async-test');
var appContext = require.context('../src', true, /\.spec\.ts/);
appContext.keys().forEach(appContext);
var testing = require('@angular/core/testing');
var browser = require('@angular/platform-browser-dynamic/testing');
testing.TestBed.initTestEnvironment(browser.BrowserDynamicTestingModule, browser.platformBrowserDynamicTesting());
- Ngôn ngữ chính
- TypeScript
- Star
- 370
- Fork
- 144
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của ionic-team/ionic-unit-testing-example
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 20/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 20/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
ionic-team/ionic-unit-testing-example#91 · 7 bình luận · 11 reaction ·
-
Valdiating Ionic-options Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
Tất cả issue của ionic-team/ionic-unit-testing-example
Issue tương tự
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Crush Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
ElementsProject/cln-application#167 · 1 bình luận · 1 reaction ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Quantco/pnpm-licenses#17 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100