How to use the pn/fs.readFileSync function in pn

To help you get started, we’ve selected a few pn examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jkphl / svg-sprite / test / svg-sprite.js View on Github external
describe('svg-sprite', function () {
    var weather = glob.glob.sync('**/weather*.svg', { cwd: cwdWeather }),
        align = glob.glob.sync('**/*.svg', { cwd: cwdAlign }),
        previewTemplate = fs.readFileSync(path.join(__dirname, 'tmpl', 'css.html'), 'utf-8');

    describe('with no arguments', function () {
        var spriter = new SVGSpriter({
            shape: {
                dest: 'svg'
            }
        });

        describe('with no SVG files', function () {

            it('has an empty result', function (done) {
                spriter.compile(function (error, result, data) {
                    should(error).not.ok;
                    should(result).be.an.Object;
                    should(result).be.empty;
                    should(data).be.an.Object;
github jkphl / svg-sprite / test / svg-sprite.js View on Github external
files.forEach(function (file) {
        spriter.add(
            path.resolve(path.join(cwd, file)),
            file,
            fs.readFileSync(path.join(cwd, file), { encoding: 'utf-8' })
        );
    });
}