本文整理匯總了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);
}
示例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);
}
示例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}"`);
}
示例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}"`);
}
示例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);
}
示例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);
}
示例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);
});