当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript file.read方法代码示例

本文整理汇总了TypeScript中grunt.file.read方法的典型用法代码示例。如果您正苦于以下问题:TypeScript file.read方法的具体用法?TypeScript file.read怎么用?TypeScript file.read使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在grunt.file的用法示例。


在下文中一共展示了file.read方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: testFile

function testFile(test, path: string) {
    var actualFileName = 'test/' + path,
        expectedFileName = 'test/expected/' + path;
    var actual = grunt.file.read(actualFileName);
    var expected = grunt.file.read(expectedFileName);
    test.equal(expected, actual, 'Actual did not match expected:' + grunt.util.linefeed +
        actualFileName + grunt.util.linefeed +
        expectedFileName);
}
开发者ID:MasGaNo,项目名称:grunt-ts,代码行数:9,代码来源:test.ts

示例2: testExpectedFile

function testExpectedFile(test, path: string) {
    var actualFileName = path.replace('\\expected', '').replace('/expected', ''),
        expectedFileName = path;

    var actual = grunt.file.read(actualFileName);
    var expected = grunt.file.read(expectedFileName);
    test.equal(expected, actual, 'Actual did not match expected:' + grunt.util.linefeed +
        actualFileName + grunt.util.linefeed +
        expectedFileName);
}
开发者ID:MasGaNo,项目名称:grunt-ts,代码行数:10,代码来源:test.ts

示例3: testFile

function testFile(test, path: string, whitespaceDifferencesOK = false) {
    var actualFileName = 'test/' + path,
        expectedFileName = 'test/expected/' + path;

    var actual = grunt.file.read(actualFileName);
    var expected = grunt.file.read(expectedFileName);

    if (whitespaceDifferencesOK) {
      actual = actual.replace(/\s/g,'');
      expected = expected.replace(/\s/g,'');
    }

    test.equal(expected, actual, `Actual did not match expected.  Run this to compare:` +
      `${grunt.util.linefeed}kdiff3 "${actualFileName}" "${expectedFileName}"`);
}
开发者ID:davidparsson,项目名称:grunt-ts,代码行数:15,代码来源:test.ts

示例4: testExpectedFile

export function testExpectedFile(test, path: string, whitespaceDifferencesOK = false) {
    let actualFileName = path.replace('\\expected', '').replace('/expected', '')
      .replace('.expected.', '.');
    let expectedFileName = path;

    var actual = grunt.file.read(actualFileName);
    var expected = grunt.file.read(expectedFileName);

    if (whitespaceDifferencesOK) {
      actual = actual.replace(/\s/g,'');
      expected = expected.replace(/\s/g,'');
    }

    test.equal(expected, actual, `Actual did not match expected.  Run this to compare:` +
      `${grunt.util.linefeed}kdiff3 "${actualFileName}" "${expectedFileName}"`);
}
开发者ID:TypeStrong,项目名称:grunt-ts,代码行数:16,代码来源:testHelpers.ts

示例5: testFile

function testFile(test, path) {
    var actual = grunt.file.read('test/' + path);
    var expected = grunt.file.read('test/expected/' + path);
    test.equal(expected, actual, 'tested path: ' + path);
}
开发者ID:ThaNarie,项目名称:grunt-ts,代码行数:5,代码来源:test.ts

示例6: testExpectedFile

function testExpectedFile(test, path: string) {
    var actual = grunt.file.read(path.replace('\\expected', '').replace('/expected', ''));
    var expected = grunt.file.read(path);
    test.equal(expected, actual, 'tested path: ' + path);
}
开发者ID:ThaNarie,项目名称:grunt-ts,代码行数:5,代码来源:test.ts

示例7:

		['foo', 'bar'].forEach(base => {
			var filename = base + '.css';
			var actual = grunt.file.read('tmp/' + filename);
			var expected = grunt.file.read('test/expected/' + filename);
			expect(actual).to.eq(expected);
		});
开发者ID:jedmao,项目名称:grunt-blink,代码行数:6,代码来源:blink.spec.ts


注:本文中的grunt.file.read方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。