本文整理汇总了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);
});