New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modification of deleting cache #21

Merged
merged 1 commit into from Sep 14, 2014

Conversation

7 participants
@navelpluisje
Contributor

navelpluisje commented Jun 3, 2014

Added delete of the full cache of the specs. The children of the specs.js cache are now also deleted.

Now the test run correctly after every save of the files. So yo're able to use it in a watch().

Added delete of the full cache of the specs. The children of the spec…
…s.js cache are now also deleted.

Now the test run correctly after every save of the files. So yo're able to use it in a watch().
@toutpt

This comment has been minimized.

Show comment
Hide comment
@toutpt

toutpt commented Jun 4, 2014

Thanks ! reported on stackoverflow http://stackoverflow.com/q/21911328/622081

@navelpluisje

This comment has been minimized.

Show comment
Hide comment
@navelpluisje
Contributor

navelpluisje commented Jun 15, 2014

delete require.cache[files.children[i].id];
}
}
delete require.cache[require.resolve(path.resolve(file.path))];

This comment has been minimized.

@sindresorhus

sindresorhus Jul 25, 2014

Owner

this is already handled here.

@sindresorhus

sindresorhus Jul 25, 2014

Owner

this is already handled here.

This comment has been minimized.

@merlinran

merlinran Jul 25, 2014

I haven't test if it works...

@merlinran

merlinran Jul 25, 2014

I haven't test if it works...

This comment has been minimized.

@navelpluisje

navelpluisje Jul 26, 2014

Contributor

But not the children(files added by the require in the testfiles) of this file. This way the required files are not deleted from the cache, only their reference. This will make it impossible to run the same test twice without restarting gulp.

@navelpluisje

navelpluisje Jul 26, 2014

Contributor

But not the children(files added by the require in the testfiles) of this file. This way the required files are not deleted from the cache, only their reference. This will make it impossible to run the same test twice without restarting gulp.

This comment has been minimized.

@kpesanka

kpesanka Sep 12, 2014

Thanks for the fix, navelpluisje - worked beautifully. I'm not sure why this PR was closed, when the bug still persists, and your change fixes it.

@kpesanka

kpesanka Sep 12, 2014

Thanks for the fix, navelpluisje - worked beautifully. I'm not sure why this PR was closed, when the bug still persists, and your change fixes it.

This comment has been minimized.

@navelpluisje

navelpluisje Sep 12, 2014

Contributor

Me neither. I hope he will reconsider this request.
Anyway I'm glad I could help you out with this modification.

@navelpluisje

navelpluisje Sep 12, 2014

Contributor

Me neither. I hope he will reconsider this request.
Anyway I'm glad I could help you out with this modification.

@sindresorhus

This comment has been minimized.

Show comment
Hide comment
@sindresorhus

sindresorhus Sep 14, 2014

Owner

Sorry, I'm not sure why I closed this. Probably closed the wrong PR or something.

Owner

sindresorhus commented Sep 14, 2014

Sorry, I'm not sure why I closed this. Probably closed the wrong PR or something.

sindresorhus added a commit that referenced this pull request Sep 14, 2014

Merge pull request #21 from navelpluisje/master
Modification of deleting cache

@sindresorhus sindresorhus merged commit 121f857 into sindresorhus:master Sep 14, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details

sindresorhus added a commit that referenced this pull request Sep 14, 2014

@sindresorhus

This comment has been minimized.

Show comment
Hide comment
@sindresorhus

sindresorhus Sep 14, 2014

Owner

Available in 1.0.1

Owner

sindresorhus commented Sep 14, 2014

Available in 1.0.1

@navelpluisje

This comment has been minimized.

Show comment
Hide comment
@navelpluisje

navelpluisje Sep 14, 2014

Contributor

Hi Sindre, Thanx for your reconsideration.

Contributor

navelpluisje commented Sep 14, 2014

Hi Sindre, Thanx for your reconsideration.

@YBNSalesEngineering

This comment has been minimized.

Show comment
Hide comment
@YBNSalesEngineering

YBNSalesEngineering Feb 18, 2015

Still seeing this issue in "gulp-jasmine": "^2.0.0" . I am doing a basic console.log in an it block. When I change the args to console.log gulp.watch will refresh and pipe through jasmine although my console log shows my previous entry. When I kill the process and start again I see my latest log. I was previously on 1.0.1 and upgraded to 2.0.0.

My task..

gulp.task('test', function () {
    return gulp.src(testFiles)
        .pipe(jasmine({verbose : true, includeStackTrace : true}));
});

gulp.task('tdd', function() {
    return gulp.watch(allFiles, ['test']);
});

YBNSalesEngineering commented Feb 18, 2015

Still seeing this issue in "gulp-jasmine": "^2.0.0" . I am doing a basic console.log in an it block. When I change the args to console.log gulp.watch will refresh and pipe through jasmine although my console log shows my previous entry. When I kill the process and start again I see my latest log. I was previously on 1.0.1 and upgraded to 2.0.0.

My task..

gulp.task('test', function () {
    return gulp.src(testFiles)
        .pipe(jasmine({verbose : true, includeStackTrace : true}));
});

gulp.task('tdd', function() {
    return gulp.watch(allFiles, ['test']);
});
@jbblanchet

This comment has been minimized.

Show comment
Hide comment
@jbblanchet

jbblanchet Feb 23, 2015

Contributor

Hi @YBNSalesEngineering,

I tried to reproduce your bug using the latest version of gulp-jasmine, and I wasn't able to. Here are my steps:

  1. in a brand new folder, ran npm install gulp gulp-jasmine.

  2. created the following gulpfile.js

var gulp = require("gulp");
var jasmine = require("gulp-jasmine");

gulp.task('test', function () {
    return gulp.src(["tests/*"])
        .pipe(jasmine({verbose : true, includeStackTrace : true}));
});

gulp.task('tdd', function() {
    return gulp.watch(["tests/*", "src/*"], ['test']);
});
  1. under tests, create the following spec file:
describe("a test", function () {
    it("logs", function () {
        console.log("Hello world!");
    });
});
  1. ran gulp tdd

  2. changed Hello world! to Hello Cleveland! and saved the file.

My console correctly logged Hello Cleveland!

If there's anything I missed, let me know.

Contributor

jbblanchet commented Feb 23, 2015

Hi @YBNSalesEngineering,

I tried to reproduce your bug using the latest version of gulp-jasmine, and I wasn't able to. Here are my steps:

  1. in a brand new folder, ran npm install gulp gulp-jasmine.

  2. created the following gulpfile.js

var gulp = require("gulp");
var jasmine = require("gulp-jasmine");

gulp.task('test', function () {
    return gulp.src(["tests/*"])
        .pipe(jasmine({verbose : true, includeStackTrace : true}));
});

gulp.task('tdd', function() {
    return gulp.watch(["tests/*", "src/*"], ['test']);
});
  1. under tests, create the following spec file:
describe("a test", function () {
    it("logs", function () {
        console.log("Hello world!");
    });
});
  1. ran gulp tdd

  2. changed Hello world! to Hello Cleveland! and saved the file.

My console correctly logged Hello Cleveland!

If there's anything I missed, let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment