The most straight-forward way to do this is probably to write a function that defines the subset of shared behaviors that you have and call that function from within the different `describes`. You can either use the Jasmine-provided `this` and a `beforeEach`/`beforeAll` or pass information into the function if you know it at suite declaration time. This would look something like:
function shared() {
it('uploads', function() {
upload(this.file);
});
}
describe('big', function() {
beforeEach(function() {
this.file = getBigFile();
});
shared();
});
or
function shared(fileName) {
it('uploads', () => { upload(fileName) });
}
describe('big, () => {
shared('bigFile.txt');
});
Hope this helps. Thanks for using Jasmine!
- Gregg