}, function (err, result) {
          expect(err, 'to be null');
          expect(result, 'to exhaustively satisfy', {
            css: expect.it('when decoded as', 'utf8', 'to be', '/* line 1, stdin */\nbody {\n  background: hotpink; }\n'),
            map: undefined,
            stats: expect.it('to satisfy', {
              includedFiles: []
            })
          });

          done();
        });
      it('should render basic example with sourceComments', function () {
        var result = sass.renderSync({
          data: 'body { background: hotpink; }',
          sourceComments: true
        });

        expect(result, 'to exhaustively satisfy', {
          css: expect.it('when decoded as', 'utf8', 'to be', '/* line 1, stdin */\nbody {\n  background: hotpink; }\n'),
          stats: expect.it('to satisfy', {
            includedFiles: []
          })
        });
      });
Example #3
0
                it('should have a ' + otherSpace.name + ' conversion method', function () {
                    var expected = {};

                    expected[otherSpace.name.toLowerCase()] = expect.it('to be a function');

                    expect(clr, 'to satisfy', expected);
                });
Example #4
0
                    it('should have a "' + shortHand + '" shorthand method', function () {
                        var expected = {};

                        expected[shortHand] = expect.it('to be a function').and('to have arity', 2);

                        expect(clr, 'to satisfy', expected);
                    });
Example #5
0
                    it('should have a "' + channel + '" method', function () {
                        var expected = {};

                        expected[channel] = expect.it('to be a function').and('to have arity', 2);

                        expect(clr, 'to satisfy', expected);
                    });
        }, function (err, result) {
          expect(err, 'to be null');
          expect(result, 'to exhaustively satisfy', {
            css: expect.it('when decoded as', 'utf8', 'to be', 'body {\n  background: hotpink; }\n'),
            map: undefined,
            stats: {
              entry: 'data',
              start: expect.it('to be a number'),
              includedFiles: [],
              end: expect.it('to be a number'),
              duration: expect.it('to be a number')
            }
          });

          done();
        });
      it('should render basic example', function () {
        var result = sass.renderSync({
          data: 'body { background: hotpink; }'
        });

        expect(result, 'to exhaustively satisfy', {
          css: expect.it('when decoded as', 'utf8', 'to be', 'body {\n  background: hotpink; }\n'),
          stats: {
            entry: 'data',
            start: expect.it('to be a number'),
            includedFiles: [],
            end: expect.it('to be a number'),
            duration: expect.it('to be a number')
          }
        });
      });
        }, function (err, result) {
          expect(err, 'to be null');
          expect(result, 'to exhaustively satisfy', {
            css: expect.it('when decoded as', 'utf8', 'to be', '/* line 3, ' + process.cwd() + '/fixtures/basic.scss */\nbody {\n  background: red; }\n'),
            map: undefined,
            stats: {
              entry: /fixtures\/basic\.scss$/,
              start: expect.it('to be a number'),
              includedFiles: [
                /fixtures\/basic\.scss$/
              ],
              end: expect.it('to be a number'),
              duration: expect.it('to be a number')
            }
          });

          done();
        });
 it('should not mess up buffers when creating a clone of the passed object', function () {
     var options = {
         'data': {
             _isFile: true,
             content: new Buffer('foo')
         }
     };
     return expect(rewriteMockFsOptions(options), 'to satisfy', {
         '/data': expect.it('when called with', [], 'to satisfy', {
             _content: new Buffer('foo')
         })
     });
 });
 it('should map objects with the _isFile property set to true through mock.file', function () {
     var options = {
         '/foobar.txt': {
             _isFile: true,
             content: 'foobar!'
         }
     };
     return expect(rewriteMockFsOptions(options), 'to satisfy', {
         '/foobar.txt': expect.it('when called with', [], 'to satisfy', {
             _content: new Buffer('foobar!')
         })
     });
 });
 it('should map objects with the _isDirectory property set to true through mock.directory', function () {
     var options = {
         '/data': {
             _isDirectory: true,
             items: {
                 'foobar.txt': 'foobar!'
             }
         }
     };
     return expect(rewriteMockFsOptions(options), 'to satisfy', {
         '/data': expect.it('when called with', [], 'to satisfy', {
             '_items': {
                 'foobar.txt': {
                     _content: new Buffer('foobar!')
                 }
             }
         })
     });
 });
 it('should map objects with the _isSymlink property set to true through mock.symlink', function () {
     var options = {
         '/regularFile': 'foobar',
         '/aSymLink': {
             _isSymlink: true,
             path: 'regularFile'
         }
     };
     var rewrittenOptions = rewriteMockFsOptions(options);
     return expect(rewrittenOptions['/aSymLink'](), 'to satisfy',
         expect.it('not to have property', '_isSymlink')
             .and('to have property', '_path', 'regularFile')
             .and('to have properties', [
                 '_ctime',
                 '_atime',
                 '_mtime',
                 '_mode',
                 '_uid'
             ]));
 });
Example #13
0
 it('should have an equals method', function () {
     expect(clr, 'to satisfy', {
         equals: expect.it('to be a function').and('to have arity', 2)
     })
 });
Example #14
0
 otherSpace.channels.forEach(function (channelName) {
     expected['_' + channelName] = expect.it('to be a number');
 });
Example #15
0
 it('should not set the "encrypted" property if the protocol is http', function () {
     expect(new HttpRequest({ url: 'GET http://foo.com/' }), 'to satisfy', { encrypted: expect.it('to be falsy') });
 });