小编cal*_*via的帖子

Webpack Karma Istanbul为TypeScript重新映射

我正在开发一个客户端应用程序,我在创建正确的Karma配置时遇到了麻烦.现在,我的设置如下:

Webpack:使用ts-loader,编译TypeScript,资产等.

Karma:使用webpack插件,加载Webpack配置(使用ts-loader),然后使用Jasmine + PhantomJS运行所有单元测试

单元测试所有运行正常,但我还没有找到一种方法来处理webpack istanbul重映射.Karma-webpacks似乎没有生成源映射以允许重映射发生.任何指针将不胜感激!

Karma配置:

var webpackConfig = require("./webpack.config.js");
delete webpackConfig.entry;

module.exports = function (config) {
    config.set({
        // base path that will be used to resolve all patterns (eg. files, exclude)
        basePath: '',

        // frameworks to use
        // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
        frameworks: ['jasmine'],

        // list of files / patterns to load in the browser
        files: [
            // Non-automatically bundled libraries
            'app/client/js/lib/easeljs.min.js',
            'app/client/js/lib/tweenjs.min.js',
            // Entry File
            'app/client/js/index.ts',
            'app/client/html/**/*.html',

            // Test files and dependencies
            'node_modules/angular-mocks/angular-mocks.js',
            'test/client/**/*.spec.js'
        ],

        // preprocess …
Run Code Online (Sandbox Code Playgroud)

code-coverage typescript istanbul webpack

11
推荐指数
1
解决办法
4648
查看次数

TypeScript React Native String文字分配错误

关于TypeScript,我遇到了一个非常奇怪的错误,告诉我字符串文字不匹配.(TypeScript v1.8)

import { Component } from "react";
import {
  StyleSheet,
  Text,
  View
} from "react-native";

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: "center",
    alignItems: "center",
    backgroundColor: "#F5FCFF",
  },
  welcome: {
    fontSize: 20,
    textAlign: "center",
    margin: 10,
  }
});

export class App extends Component<any, any> {
  render() {
    return (
      <View style={styles.container}>
        <Text style={styles.welcome}>
          Welcome to React Native!
        </Text>
      </View>
    );
  }
}
Run Code Online (Sandbox Code Playgroud)

错误:

src\client\index.ios.tsx(19,15): error TS2322: Type '{ fontSize: number; textAlign: string; margin: number; }' is not …
Run Code Online (Sandbox Code Playgroud)

string object literals variable-assignment typescript

6
推荐指数
2
解决办法
4117
查看次数

AWS Spot实例限制

在过去的一个月中,我使用了竞价型实例来启动和终止实例。目前,我没有在AWS上运行的实例(所有竞价型实例均已终止)。但是,当我尝试启动新的竞价型实例时,它告诉我“超出了最大竞价型实例数量”。

我已经阅读了有关实例限制的文档。但是,我对该限制的工作方式感到困惑。它会限制您可以运行的并发实例的数量,还是曾经启动的实例总数?

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-limits.html#spot-limits-general

amazon-ec2 amazon-web-services

6
推荐指数
1
解决办法
4786
查看次数