草庐IT

gulp-jasmine

全部标签

node.js - 如果 gulp 安装在与 gulpfile.js 不同的文件夹中(node_modules),你如何运行 gulp

我在一个目录中有gulpfile.js,在另一个目录中有node_modules。当我运行gulp时,我得到了错误-'在'..(目录)中找不到本地gulp..尝试运行:npminstallgulp'问题是-我无法在gulpfile.js的目录中安装gulp,因此我需要一种方法来告诉gulp引用我安装了gulp的另一个目录。 最佳答案 如果你不想的话,你不需要全局安装gulp。你可以做的是运行你的gulp可执行文件(从你的node_modules),然后使用--gulpfile参数传入你的gulpfile的位置。此外,如果您想控制gu

node.js - 如果 gulp 安装在与 gulpfile.js 不同的文件夹中(node_modules),你如何运行 gulp

我在一个目录中有gulpfile.js,在另一个目录中有node_modules。当我运行gulp时,我得到了错误-'在'..(目录)中找不到本地gulp..尝试运行:npminstallgulp'问题是-我无法在gulpfile.js的目录中安装gulp,因此我需要一种方法来告诉gulp引用我安装了gulp的另一个目录。 最佳答案 如果你不想的话,你不需要全局安装gulp。你可以做的是运行你的gulp可执行文件(从你的node_modules),然后使用--gulpfile参数传入你的gulpfile的位置。此外,如果您想控制gu

javascript - Jasmine Node 说 "0 tests"当有*有*测试

我希望这会说“1次测试”,但它会说“0次测试”。知道为什么吗?这是在OSX上。$jasmine-node--verbosemy.spec.jsundefinedFinishedin0.001seconds0tests,0assertions,0failures,0skipped$catmy.spec.jsdescribe("bar",function(){it("works",function(){expect("foo").toEqual("foo");});});$jasmine-node--version1.11.0$npm--version1.3.5$node-vv0.4.12

javascript - Jasmine Node 说 "0 tests"当有*有*测试

我希望这会说“1次测试”,但它会说“0次测试”。知道为什么吗?这是在OSX上。$jasmine-node--verbosemy.spec.jsundefinedFinishedin0.001seconds0tests,0assertions,0failures,0skipped$catmy.spec.jsdescribe("bar",function(){it("works",function(){expect("foo").toEqual("foo");});});$jasmine-node--version1.11.0$npm--version1.3.5$node-vv0.4.12

node.js - Jasmine (mocha) 嵌套 "it"测试

我试图测试项目的后续创建/删除(在mongoDB中通过mongoose)。创建是异步的问题,它在回调函数中返回创建项目的ID,我需要这个ID来删除创建的项目,所以我尝试了以下mocha代码(以不同的方式)但它没有工作。describe('ItemModel',function(){it('shouldbeabletocreateitem',function(done){varitem=newItem({name:{first:"Alex"});item.save(function(err,data){it('shouldbeabletodeletedcreateditem',funct

node.js - Jasmine (mocha) 嵌套 "it"测试

我试图测试项目的后续创建/删除(在mongoDB中通过mongoose)。创建是异步的问题,它在回调函数中返回创建项目的ID,我需要这个ID来删除创建的项目,所以我尝试了以下mocha代码(以不同的方式)但它没有工作。describe('ItemModel',function(){it('shouldbeabletocreateitem',function(done){varitem=newItem({name:{first:"Alex"});item.save(function(err,data){it('shouldbeabletodeletedcreateditem',funct

node.js - gulp sass 源码图

我需要帮助将源映射添加到同一个CSS输出文件夹中的SASS编译器。到目前为止,我必须在gulpfile.js中安装gulp-sourcemaps模块,但不知道将sourcemaps.write绑定(bind)为gulp.task是否成功。非常感谢任何帮助:)vargulp=require('gulp');varsass=require('gulp-sass');varsourcemaps=require('gulp-sourcemaps');varbs=require('browser-sync').create();gulp.task('browser-sync',['sass'],

node.js - gulp sass 源码图

我需要帮助将源映射添加到同一个CSS输出文件夹中的SASS编译器。到目前为止,我必须在gulpfile.js中安装gulp-sourcemaps模块,但不知道将sourcemaps.write绑定(bind)为gulp.task是否成功。非常感谢任何帮助:)vargulp=require('gulp');varsass=require('gulp-sass');varsourcemaps=require('gulp-sourcemaps');varbs=require('browser-sync').create();gulp.task('browser-sync',['sass'],

javascript - 在继续下一个任务之前使 gulp 同步写入文件

gulpfile.jsgulp.task('browser-bundle',['react'],function(){...});gulp.task('react',function(){gulp.src(options.JSX_SOURCE).pipe(react()).pipe(gulp.dest(options.JSX_DEST))});如您所见,我有浏览器捆绑任务,具体取决于react任务。我相信这可以按预期工作,因为在输出中我看到了:[gulp]Running'react'...[gulp]Finished'react'in3.43ms[gulp]Running'browse

javascript - 在继续下一个任务之前使 gulp 同步写入文件

gulpfile.jsgulp.task('browser-bundle',['react'],function(){...});gulp.task('react',function(){gulp.src(options.JSX_SOURCE).pipe(react()).pipe(gulp.dest(options.JSX_DEST))});如您所见,我有浏览器捆绑任务,具体取决于react任务。我相信这可以按预期工作,因为在输出中我看到了:[gulp]Running'react'...[gulp]Finished'react'in3.43ms[gulp]Running'browse