Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import glob from 'glob';
import Jasmine from 'jasmine';
const jasmine = new Jasmine();
const pattern = process.argv[2] || 'test/spec/*Spec.js';
jasmine.loadConfig({
random: false,
stopSpecOnExpectationFailure: false
});
// Load your specs
glob(pattern, function (er, files) {
Promise.all(
files
// Use relative paths
.map(f => f.replace(/^([^\/])/, './$1'))
.map(f => import(f)
.catch(e => {
console.error('** Error loading ' + f + ': ');
name: 'testFile',
alias: 'f',
type: String,
},
]);
// Set the env file
const result2 = dotenv.config({
path: `./env/test.env`,
});
if (result2.error) {
throw result2.error;
}
// Init Jasmine
const jasmine = new Jasmine(null);
// Set location of test files
jasmine.loadConfig({
random: true,
spec_dir: 'spec',
spec_files: [
'./**/*.spec.ts',
],
stopSpecOnExpectationFailure: false,
});
// On complete callback function
jasmine.onComplete((passed: boolean) => {
if (passed) {
logger.info('All tests have passed :)');
} else {
import Jasmine from 'jasmine'; // eslint-disable-line
const jas = new Jasmine();
jas.loadConfigFile('src/spec/support/jasmine.json');
jas.execute();
import Jasmine from 'jasmine'
import svgdom from 'svgdom'
import { buildCanvas, buildFixtures, clear } from './helpers.js'
import { registerWindow } from '../src/main.js'
const jasmine = new Jasmine()
//jasmine.loadConfigFile('spec/support/jasmine.json')
jasmine.loadConfig({
"spec_dir": "spec/spec",
"spec_files": [
"types/*.js",
// "!(helpers).js"
],
"helpers": [
// "helpers.js"
]
})
jasmine.jasmine.currentEnv_.beforeEach(() => {
let win = /*new*/ svgdom
import find from 'find';
import Jasmine from 'jasmine';
import commandLineArgs from 'command-line-args';
import { logger } from '@shared';
// Setup command line options
const options = commandLineArgs([
{
name: 'testFile',
alias: 'f',
type: String,
},
]);
// Init Jasmine
const jasmine = new Jasmine(null);
// Set location of test files
jasmine.loadConfig({
random: true,
spec_dir: 'spec',
spec_files: [
'./**/*.spec.ts',
],
stopSpecOnExpectationFailure: false,
});
// On complete callback function
jasmine.onComplete((passed: boolean) => {
if (passed) {
logger.info('All tests have passed :)');
} else {
import Jasmine from 'jasmine';
import jasmineReporters from 'jasmine-reporters';
var jasmine = new Jasmine();
var junitReporter = new jasmineReporters.JUnitXmlReporter({
savePath: 'target/junit-report',
consolidateAll: false
});
jasmine.loadConfigFile('test/spec/support/jasmine.json');
jasmine.addReporter(junitReporter);
jasmine.execute();
import Jasmine from 'jasmine';
import {
SpecReporter
} from 'jasmine-spec-reporter';
const jasmine = new Jasmine();
jasmine.env.clearReporters();
jasmine.addReporter(new SpecReporter({
spec: {
displayPending: true
}
}));
jasmine.loadConfigFile('./jasmine.json');
jasmine.execute();
import Jasmine from 'jasmine';
let jasmine = new Jasmine();
jasmine.loadConfigFile('./spec/support/jasmine.json');
jasmine.execute();
import Jasmine from 'jasmine';
import {
SpecReporter
} from 'jasmine-spec-reporter';
const jasmine = new Jasmine();
jasmine.env.clearReporters();
jasmine.addReporter(new SpecReporter({
spec: {
displayPending: true
}
}));
jasmine.loadConfigFile('./jasmine.json');
jasmine.execute();
import Jasmine from 'jasmine'
const jasmine = new Jasmine()
jasmine.loadConfigFile('spec/support/jasmine.json')
jasmine.execute()