當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。