How to use artifactsFolder method in Best

Best JavaScript code snippet using best

gulpfile.js

Source:gulpfile.js Github

copy

Full Screen

1// Copyright (c) Microsoft. All rights reserved.2// Licensed under the MIT license. See LICENSE file in the project root for full license information.3"use strict";4let fs = require("fs");5let path = require("path");6let del = require("del");7let glob = require("glob");8let gulp = require("gulp");9let nconf = require("nconf");10let Common = require("./out/common").Common;11let Guard = require("./out/common").Guard;12let Myget = require("./out/myget").Myget;13let Github = require("./out/github").Github;14let Chocolatey = require("./out/chocolatey").Chocolatey;15let SyncBranch = require("./out/syncBranch").SyncBranch;16let configFile = path.resolve("config_gulp.json");17if (!fs.existsSync(configFile)) {18 throw new Error("Can't find config file");19}20nconf.add("configuration", { type: "file", file: configFile });21let config = {22 "docfx": nconf.get("docfx"),23 "firefox": nconf.get("firefox"),24 "myget": nconf.get("myget"),25 "git": nconf.get("git"),26 "choco": nconf.get("choco"),27 "sync": nconf.get("sync")28};29config.myget.exe = process.env.NUGETEXE || config.myget.exe;30Guard.argumentNotNull(config.docfx, "config.docfx", "Can't find docfx configuration.");31Guard.argumentNotNull(config.firefox, "config.docfx", "Can't find firefox configuration.");32Guard.argumentNotNull(config.myget, "config.docfx", "Can't find myget configuration.");33Guard.argumentNotNull(config.git, "config.docfx", "Can't find git configuration.");34Guard.argumentNotNull(config.choco, "config.docfx", "Can't find choco configuration.");35gulp.task("build", () => {36 Guard.argumentNotNullOrEmpty(config.docfx.home, "config.docfx.home", "Can't find docfx home directory in configuration.");37 return Common.execAsync("powershell", ["./build.ps1", "-prod"], config.docfx.home);38});39gulp.task("build:release", () => {40 Guard.argumentNotNullOrEmpty(config.docfx.home, "config.docfx.home", "Can't find docfx home directory in configuration.");41 return Common.execAsync("powershell", ["./build.ps1", "-prod", "-release"], config.docfx.home);42});43gulp.task("clean", () => {44 Guard.argumentNotNullOrEmpty(config.docfx.artifactsFolder, "config.docfx.artifactsFolder", "Can't find docfx artifacts folder in configuration.");45 Guard.argumentNotNullOrEmpty(config.docfx.targetFolder, "config.docfx.targetFolder", "Can't find docfx target folder in configuration.");46 let artifactsFolder = path.resolve(config.docfx.artifactsFolder);47 let targetFolder = path.resolve(config.docfx["targetFolder"]);48 return del([artifactsFolder, targetFolder], { force: true }).then((paths) => {49 if (!paths || paths.length === 0) {50 console.log("Folders not exist, no need to clean.");51 } else {52 console.log("Deleted: \n", paths.join("\n"));53 }54 });55});56gulp.task("e2eTest:installFirefox", () => {57 Guard.argumentNotNullOrEmpty(config.firefox.version, "config.firefox.version", "Can't find firefox version in configuration.");58 process.env.Path += ";C:/Program Files/Mozilla Firefox";59 return Common.execAsync("choco", ["install", "firefox", "--version=" + config.firefox.version, "-y", "--force"]);60});61gulp.task("e2eTest:restoreSeed", async () => {62 Guard.argumentNotNullOrEmpty(config.docfx.docfxSeedRepoUrl, "config.docfx.docfxSeedRepoUrl", "Can't find docfx-seed repo url in configuration.");63 Guard.argumentNotNullOrEmpty(config.docfx.docfxSeedHome, "config.docfx.docfxSeedHome", "Can't find docfx-seed in configuration.");64 return await Common.execAsync("git", ["clone", config.docfx.docfxSeedRepoUrl, config.docfx.docfxSeedHome]);65});66gulp.task("e2eTest:buildSeed", () => {67 Guard.argumentNotNullOrEmpty(config.docfx.exe, "config.docfx.exe", "Can't find docfx.exe in configuration.");68 Guard.argumentNotNullOrEmpty(config.docfx.docfxSeedHome, "config.docfx.docfxSeedHome", "Can't find docfx-seed in configuration.");69 return Common.execAsync(path.resolve(config.docfx["exe"]), ["docfx.json"], config.docfx.docfxSeedHome);70});71gulp.task("e2eTest:restore", () => {72 Guard.argumentNotNullOrEmpty(config.docfx.e2eTestsHome, "config.docfx.e2eTestsHome", "Can't find E2ETest directory in configuration.");73 return Common.execAsync("dotnet", ["restore"], config.docfx.e2eTestsHome);74});75gulp.task("e2eTest:test", () => {76 Guard.argumentNotNullOrEmpty(config.docfx.e2eTestsHome, "config.docfx.e2eTestsHome", "Can't find E2ETest directory in configuration.");77 return Common.execAsync("dotnet", ["test"], config.docfx.e2eTestsHome);78});79gulp.task("e2eTest", gulp.series("e2eTest:installFirefox", "e2eTest:restoreSeed", "e2eTest:buildSeed", "e2eTest:restore", "e2eTest:test"));80gulp.task("publish:myget-dev", () => {81 Guard.argumentNotNullOrEmpty(config.docfx.artifactsFolder, "config.docfx.artifactsFolder", "Can't find artifacts folder in configuration.");82 Guard.argumentNotNullOrEmpty(config.myget.exe, "config.myget.exe", "Can't find nuget command in configuration.");83 Guard.argumentNotNullOrEmpty(config.myget.devUrl, "config.myget.devUrl", "Can't find myget url for docfx dev feed in configuration.");84 Guard.argumentNotNullOrEmpty(process.env.MGAPIKEY, "process.env.MGAPIKEY", "Can't find myget key in Environment Variables.");85 let mygetToken = process.env.MGAPIKEY;86 let artifactsFolder = path.resolve(config.docfx["artifactsFolder"]);87 return Myget.publishToMygetAsync(artifactsFolder, config.myget["exe"], mygetToken, config.myget["devUrl"]);88});89gulp.task("publish:myget-test", () => {90 Guard.argumentNotNullOrEmpty(config.docfx.artifactsFolder, "config.docfx.artifactsFolder", "Can't find artifacts folder in configuration.");91 Guard.argumentNotNullOrEmpty(config.myget.exe, "config.myget.exe", "Can't find nuget command in configuration.");92 Guard.argumentNotNullOrEmpty(config.myget.testUrl, "config.myget.testUrl", "Can't find myget url for docfx test feed in configuration.");93 Guard.argumentNotNullOrEmpty(process.env.MGAPIKEY, "process.env.MGAPIKEY", "Can't find myget key in Environment Variables.");94 let mygetToken = process.env.MGAPIKEY;95 let artifactsFolder = path.resolve(config.docfx["artifactsFolder"]);96 return Myget.publishToMygetAsync(artifactsFolder, config.myget["exe"], mygetToken, config.myget["testUrl"]);97});98gulp.task("publish:myget-master", () => {99 Guard.argumentNotNullOrEmpty(config.docfx.artifactsFolder, "config.docfx.artifactsFolder", "Can't find artifacts folder in configuration.");100 Guard.argumentNotNullOrEmpty(config.myget.exe, "config.myget.exe", "Can't find nuget command in configuration.");101 Guard.argumentNotNullOrEmpty(config.myget.masterUrl, "config.myget.masterUrl", "Can't find myget url for docfx master feed in configuration.");102 Guard.argumentNotNullOrEmpty(process.env.MGAPIKEY, "process.env.MGAPIKEY", "Can't find myget key in Environment Variables.");103 Guard.argumentNotNullOrEmpty(config.docfx.releaseNotePath, "config.docfx.releaseNotePath", "Can't find RELEASENOTE.md in configuartion.");104 let mygetToken = process.env.MGAPIKEY;105 let releaseNotePath = path.resolve(config.docfx["releaseNotePath"]);106 let artifactsFolder = path.resolve(config.docfx["artifactsFolder"]);107 return Myget.publishToMygetAsync(artifactsFolder, config.myget["exe"], mygetToken, config.myget["masterUrl"], releaseNotePath);108});109gulp.task("updateGhPage", () => {110 Guard.argumentNotNullOrEmpty(config.docfx.httpsRepoUrl, "config.docfx.httpsRepoUrl", "Can't find docfx repo url in configuration.");111 Guard.argumentNotNullOrEmpty(config.docfx.siteFolder, "config.docfx.siteFolder", "Can't find docfx site folder in configuration.");112 Guard.argumentNotNullOrEmpty(config.docfx.exe, "config.docfx.exe", "Can't find docfx exe in configuration.");113 Guard.argumentNotNullOrEmpty(config.docfx.docfxJson, "config.docfx.docfxJson", "Can't find docfx.json in configuration.");114 Guard.argumentNotNullOrEmpty(config.git.name, "config.git.name", "Can't find git user name in configuration");115 Guard.argumentNotNullOrEmpty(config.git.email, "config.git.email", "Can't find git user email in configuration");116 Guard.argumentNotNullOrEmpty(config.git.message, "config.git.message", "Can't find git commit message in configuration");117 Guard.argumentNotNullOrEmpty(process.env.TOKEN, "process.env.TOKEN", "No github account token in the environment.");118 let docfxExe = path.resolve(config.docfx.exe);119 let docfxJson = path.resolve(config.docfx.docfxJson);120 return Github.updateGhPagesAsync(config.docfx.httpsRepoUrl, config.docfx.siteFolder, docfxExe, docfxJson, config.git.name, config.git.email, config.git.message, process.env.TOKEN);121});122gulp.task("packAssetZip", () => {123 Guard.argumentNotNullOrEmpty(config.docfx.releaseFolder, "config.docfx.releaseFolder", "Can't find zip source folder in configuration.");124 Guard.argumentNotNullOrEmpty(config.docfx.assetZipPath, "config.docfx.assetZipPath", "Can't find asset zip destination folder in configuration.");125 let releaseFolder = path.resolve(config.docfx["releaseFolder"]);126 let assetZipPath = path.resolve(config.docfx["assetZipPath"]);127 Common.zipAssests(releaseFolder, assetZipPath);128 return Promise.resolve();129});130gulp.task("publish:gh-release", () => {131 Guard.argumentNotNullOrEmpty(config.docfx.releaseNotePath, "config.docfx.releaseNotePath", "Can't find RELEASENOTE.md in configuartion.");132 Guard.argumentNotNullOrEmpty(config.docfx.assetZipPath, "config.docfx.assetZipPath", "Can't find asset zip destination folder in configuration.");133 Guard.argumentNotNullOrEmpty(process.env.TOKEN, "process.env.TOKEN", "No github account token in the environment.");134 let githubToken = process.env.TOKEN;135 let releaseNotePath = path.resolve(config.docfx["releaseNotePath"]);136 let assetZipPath = path.resolve(config.docfx["assetZipPath"]);137 return Github.updateGithubReleaseAsync(config.docfx.sshRepoUrl, releaseNotePath, assetZipPath, githubToken);138});139gulp.task("publish:chocolatey", () => {140 Guard.argumentNotNullOrEmpty(config.choco.homeDir, "config.choco.homeDir", "Can't find homedir for chocolatey in configuration.");141 Guard.argumentNotNullOrEmpty(config.choco.nuspec, "config.choco.nuspec", "Can't find nuspec for chocolatey in configuration.");142 Guard.argumentNotNullOrEmpty(config.choco.chocoScript, "config.choco.chocoScript", "Can't find script for chocolatey in configuration.");143 Guard.argumentNotNullOrEmpty(config.docfx.releaseNotePath, "config.docfx.releaseNotePath", "Can't find RELEASENOTE path in configuration.");144 Guard.argumentNotNullOrEmpty(config.docfx.assetZipPath, "config.docfx.assetZipPath", "Can't find released zip path in configuration.");145 Guard.argumentNotNullOrEmpty(process.env.CHOCO_TOKEN, "process.env.CHOCO_TOKEN", "No chocolatey.org account token in the environment.");146 let chocoToken = process.env.CHOCO_TOKEN;147 let releaseNotePath = path.resolve(config.docfx["releaseNotePath"]);148 let assetZipPath = path.resolve(config.docfx["assetZipPath"]);149 let chocoScript = path.resolve(config.choco["chocoScript"]);150 let nuspec = path.resolve(config.choco["nuspec"]);151 let homeDir = path.resolve(config.choco["homeDir"]);152 return Chocolatey.publishToChocolateyAsync(releaseNotePath, assetZipPath, chocoScript, nuspec, homeDir, chocoToken);153});154gulp.task("syncBranchCore", () => {155 Guard.argumentNotNullOrEmpty(config.docfx.sshRepoUrl, "config.docfx.sshRepoUrl", "Can't find docfx repo url in configuration.");156 Guard.argumentNotNullOrEmpty(config.docfx.home, "config.docfx.home", "Can't find docfx home directory in configuration.");157 Guard.argumentNotNullOrEmpty(config.sync.fromBranch, "config.sync.fromBranch", "Can't find source branch in sync configuration.");158 Guard.argumentNotNullOrEmpty(config.sync.targetBranch, "config.sync.targetBranch", "Can't find target branch in sync configuration.");159 if (Common.isThirdWeekInSprint()) {160 console.log("Ignore to sync in the third week of a sprint");161 process.exit(2);162 }163 let docfxHome = path.resolve(config.docfx.home);164 return SyncBranch.runAsync(config.docfx.sshRepoUrl, docfxHome, config.sync.fromBranch, config.sync.targetBranch);165});166gulp.task("test", gulp.series("clean", "build", "e2eTest", "publish:myget-test"));167gulp.task("dev", gulp.series("clean", "build", "e2eTest"));168gulp.task("stable", gulp.series("clean", "build", "e2eTest", "publish:myget-dev"));169gulp.task("master:build", gulp.series("clean", "build:release", "e2eTest", "updateGhPage"));170gulp.task("master:release", gulp.series("packAssetZip", "publish:myget-master", "publish:gh-release", "publish:chocolatey"));171gulp.task("syncBranch", gulp.series("syncBranchCore"));...

Full Screen

Full Screen

run-cypress-tests.js

Source:run-cypress-tests.js Github

copy

Full Screen

1/* eslint-disable no-console */2// this file is a little cypress test runner helper3// so that we can utilize our own monorepo when testing4// things like the driver, or desktop-gui, or reporter5require('@packages/coffee/register')6const _ = require('lodash')7const cp = require('child_process')8const path = require('path')9const minimist = require('minimist')10const Promise = require('bluebird')11const xvfb = require('../cli/lib/exec/xvfb')12const la = require('lazy-ass')13const is = require('check-more-types')14const fs = Promise.promisifyAll(require('fs-extra'))15const { existsSync } = require('fs')16const { basename } = require('path')17const humanTime = require('../packages/server/lib/util/human_time.coffee')18const glob = Promise.promisify(require('glob'))19const options = minimist(process.argv.slice(2))20const started = new Date()21let numFailed = 022// turn this back on for driver + desktop gui tests23// TODO how does this work?! I don't see where the copying can possible happen24process.env.COPY_CIRCLE_ARTIFACTS = 'true'25const isCircle = process.env.CI === 'true' && process.env.CIRCLECI === 'true'26// matches the value in circle.yml "store_artifacts" command27const artifactsFolder = '/tmp/artifacts'28// let us pass in project or resolve it to process.cwd() and dir29options.project = options.project || path.resolve(process.cwd(), options.dir || '')30console.log('options.project', options.project)31const prepareArtifactsFolder = () => {32 if (!isCircle) {33 return Promise.resolve()34 }35 console.log('Making folder %s', artifactsFolder)36 return fs.ensureDirAsync(artifactsFolder)37}38const fileExists = (name) => {39 return Promise.resolve(existsSync(name))40}41const copyScreenshots = (name) => {42 return () => {43 la(is.unemptyString(name), 'missing name', name)44 const screenshots = path.join(options.project, 'cypress', 'screenshots')45 return fileExists(screenshots)46 .then((exists) => {47 if (!exists) {48 return49 }50 console.log('Copying screenshots for %s from %s', name, screenshots)51 const destination = path.join(artifactsFolder, name)52 return fs.ensureDirAsync(destination)53 .then(() => {54 return fs.copyAsync(screenshots, destination, {55 overwrite: true,56 })57 })58 })59 }60}61const copyVideos = (name) => {62 return () => {63 const videos = path.join(options.project, 'cypress', 'videos')64 return fileExists(videos)65 .then((exists) => {66 if (!exists) {67 return68 }69 console.log('Copying videos for %s from %s', name, videos)70 const destination = path.join(artifactsFolder, name)71 return fs.ensureDirAsync(destination)72 .then(() => {73 return fs.copyAsync(videos, destination, {74 overwrite: true,75 })76 })77 })78 }79}80/**81 * Copies artifacts (screenshots, videos) if configured into a subfolder82 *83 * @param {string} name Spec base name84 */85const copyArtifacts = (name) => {86 return () => {87 if (!isCircle) {88 return Promise.resolve()89 }90 return copyScreenshots(name)().then(copyVideos(name))91 }92}93function isLoadBalanced (options) {94 return _.isNumber(options.index) && _.isNumber(options.parallel)95}96function spawn (cmd, args, opts) {97 return new Promise((resolve, reject) => {98 cp.spawn(cmd, args, opts)99 .on('exit', resolve)100 .on('error', reject)101 })102}103_.defaults(options, {104 dir: '',105 glob: 'cypress/integration/**/*',106})107// normalize and set to absolute path based on process.cwd108options.glob = path.resolve(options.project, options.glob)109const runSpec = (spec) => {110 console.log('\nRunning spec', spec)111 la(is.unemptyString(spec), 'missing spec filename', spec)112 // get the path to xvfb-maybe binary113 // const cmd = path.join(__dirname, '..', 'node_modules', '.bin', 'xvfb-maybe')114 const configFile = path.join(__dirname, '..', 'mocha-reporter-config.json')115 const args = [116 // '-as',117 // '\"-screen 0 1280x720x16\"',118 // '--',119 // 'node',120 path.resolve('..', '..', 'scripts', 'start.js'), // launch root monorepo start121 '--run-project',122 options.project,123 '--spec',124 spec,125 '--reporter',126 path.resolve(__dirname, '..', 'node_modules', 'mocha-multi-reporters'),127 '--reporter-options',128 `configFile=${configFile}`,129 ]130 if (options.browser) {131 args.push('--browser', options.browser)132 }133 return spawn('node', args, { stdio: 'inherit' })134 .then((code) => {135 console.log(`${spec} exited with code`, code)136 numFailed += code137 })138 .then(copyArtifacts(basename(spec)))139 .catch((err) => {140 console.log(err)141 throw err142 })143}144function run () {145 console.log('Specs found:')146 return glob(options.glob, {147 nodir: true,148 realpath: true,149 })150 .tap(prepareArtifactsFolder)151 .then((specs = []) => {152 if (options.spec) {153 return _.filter(specs, (spec) => {154 return spec.includes(options.spec)155 })156 }157 if (isLoadBalanced(options)) {158 // take the total number of specs and divide by our159 // total number of parallel nodes, ceiling the number160 const size = Math.ceil(specs.length / options.parallel)161 // chunk the specs by the total nodes162 // and then just grab this index's specs163 return _.chunk(specs, size)[options.index]164 }165 return specs166 })167 .tap(console.log)168 .each(runSpec)169 .then(() => {170 const duration = new Date() - started171 console.log('')172 console.log('Total duration:', humanTime.long(duration))173 console.log('Exiting with final code:', numFailed)174 process.exit(numFailed)175 })176}177const needsXvfb = xvfb.isNeeded()178if (needsXvfb) {179 return xvfb.start()180 .then(run)181 .finally(xvfb.stop)182}...

Full Screen

Full Screen

hash-build-artifacts.js

Source:hash-build-artifacts.js Github

copy

Full Screen

1const2 gulp = requireModule("gulp");3gulp.task("hash-build-artifacts", async () => {4 const5 path = require("path"),6 crypto = require("crypto"),7 { readFile, writeFile, ls, FsEntities } = require("yafs"),8 artifactsFolder = path.join("build", "artifacts");9 const10 buildArtifacts = await ls(artifactsFolder, {11 fullPaths: true,12 entities: FsEntities.files13 }),14 nupkg = buildArtifacts.find(p => p.match(/\.nupkg$/)),15 binaries = buildArtifacts.find(p => p.match(/apache-log4net-binaries-\d+\.\d+\.\d+.zip$/)),16 source = buildArtifacts.find(p => p.match(/apache-log4net-source-\d+\.\d+\.\d+.zip$/));17 if (!nupkg) {18 throw new Error(`apache-log4net nupkg not found in ${artifactsFolder}`);19 }20 if (!binaries) {21 throw new Error(`apache-log4net binaries zip not found in ${artifactsFolder}`);22 }23 if (!source) {24 throw new Error(`apache-log4net source zip not found in ${artifactsFolder}`);25 }26 await writeSHA512For(nupkg);27 await writeSHA512For(binaries);28 await writeSHA512For(source);29 function writeSHA512For(filepath) {30 return new Promise(async (resolve, reject) => {31 try {32 const33 hash = crypto.createHash("sha512"),34 data = await readFile(filepath);35 hash.update(data);36 const37 outfile = `${filepath}.sha512`,38 hex = hash.digest("hex"),39 contents = `${hex} *${path.basename(filepath)}`;40 await writeFile(outfile, contents);41 resolve();42 } catch (e) {43 reject(e);44 }45 });46 }...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var test = require('bestpractice');2test.artifactsFolder();3var test = require('bestpractice');4test.artifactsFolder();5var test = require('bestpractice');6test.artifactsFolder();7var test = require('bestpractice');8test.artifactsFolder();9var test = require('bestpractice');10test.artifactsFolder();11var test = require('bestpractice');12test.artifactsFolder();13var test = require('bestpractice');14test.artifactsFolder();15var test = require('bestpractice');16test.artifactsFolder();17var test = require('bestpractice');18test.artifactsFolder();19var test = require('bestpractice');20test.artifactsFolder();21var test = require('bestpractice');22test.artifactsFolder();23var test = require('bestpractice');24test.artifactsFolder();25var test = require('bestpractice');26test.artifactsFolder();27var test = require('bestpractice');28test.artifactsFolder();29var test = require('bestpractice');30test.artifactsFolder();31var test = require('bestpractice');32test.artifactsFolder();

Full Screen

Using AI Code Generation

copy

Full Screen

1var BestPractice = require('best-practice');2var bestPractice = new BestPractice();3var path = require('path');4var artifactFolder = path.join(__dirname, 'artifacts');5bestPractice.artifactsFolder(artifactFolder);6bestPractice.add('test1', 'test2');7var BestPractice = require('best-practice');8var bestPractice = new BestPractice();9var path = require('path');10var artifactFolder = path.join(__dirname, 'artifacts');11bestPractice.artifactsFolder(artifactFolder);12bestPractice.add('test1', 'test2');13var BestPractice = require('best-practice');14var bestPractice = new BestPractice();15var path = require('path');16var artifactFolder = path.join(__dirname, 'artifacts');17bestPractice.artifactsFolder(artifactFolder);18bestPractice.add('test1', 'test2');19var BestPractice = require('best-practice');20var bestPractice = new BestPractice();21var path = require('path');22var artifactFolder = path.join(__dirname, 'artifacts');23bestPractice.artifactsFolder(artifactFolder);24bestPractice.add('test1', 'test2');25var BestPractice = require('best-practice');26var bestPractice = new BestPractice();27var path = require('path');28var artifactFolder = path.join(__dirname, 'artifacts');29bestPractice.artifactsFolder(artifactFolder);30bestPractice.add('test1', 'test2');31var BestPractice = require('best-practice');32var bestPractice = new BestPractice();33var path = require('path');34var artifactFolder = path.join(__dirname, 'artifacts');35bestPractice.artifactsFolder(artifactFolder);36bestPractice.add('test1', 'test2');37var BestPractice = require('best-practice');38var bestPractice = new BestPractice();39var path = require('path');40var artifactFolder = path.join(__dirname,

Full Screen

Using AI Code Generation

copy

Full Screen

1var BestPractice = require('bestpractice');2var bestPractice = new BestPractice();3var path = require('path');4var fs = require('fs');5bestPractice.artifactsFolder(path.join(__dirname, 'artifacts'));6var test = bestPractice.test('Test 4', 'This is a test', 'test4');7test.run(function() {8 test.pass('This is a pass');9 test.fail('This is a fail');10 test.error('This is an error');11 test.info('This is an info');12 test.warn('This is a warn');13 test.done();14});15var BestPractice = require('bestpractice');16var bestPractice = new BestPractice();17var path = require('path');18var fs = require('fs');19bestPractice.artifactsFolder(path.join(__dirname, 'artifacts'));20var test = bestPractice.test('Test 5', 'This is a test', 'test5');21test.run(function() {22 test.pass('This is a pass');23 test.fail('This is a fail');24 test.error('This is an error');25 test.info('This is an info');26 test.warn('This is a warn');27 test.done();28});29var BestPractice = require('bestpractice');30var bestPractice = new BestPractice();31var path = require('path');32var fs = require('fs');33bestPractice.artifactsFolder(path.join(__dirname, 'artifacts'));34var test = bestPractice.test('Test 6', 'This is a test', 'test6');35test.run(function() {36 test.pass('This is a pass');37 test.fail('This is a fail');38 test.error('This is an error');39 test.info('This is an info');40 test.warn('This is a warn');41 test.done();42});43var BestPractice = require('bestpractice');44var bestPractice = new BestPractice();45var path = require('path');46var fs = require('fs');47bestPractice.artifactsFolder(path.join(__dirname, 'artifacts'));48var test = bestPractice.test('Test 7', 'This is a test', 'test7');49test.run(function() {50 test.pass('This

Full Screen

Using AI Code Generation

copy

Full Screen

1var BestPractice = require('bestpractice');2var fs = require('fs');3var path = require('path');4var bestPractice = new BestPractice();5var artifactsFolder = bestPractice.artifactsFolder();6var testFolder = path.join(artifactsFolder, 'test');7var testFile = path.join(testFolder, 'test.txt');8var testFileContents = 'This is a test file.';9if (!fs.existsSync(testFolder)) {10 fs.mkdirSync(testFolder);11}12fs.writeFileSync(testFile, testFileContents);

Full Screen

Using AI Code Generation

copy

Full Screen

1var bp = new BestPractices();2bp.artifactsFolder("C:/artifacts");3bp.artifactsFolder("C:/artifacts", "C:/artifacts2");4var bp = new BestPractices();5bp.artifactsFolder("C:/artifacts");6bp.artifactsFolder("C:/artifacts", "C:/artifacts2");7bp.artifactsFolder("C:/artifacts", "C:/artifacts2", "C:/artifacts3");8var bp = new BestPractices();9bp.artifactsFolder("C:/artifacts");10bp.artifactsFolder("C:/artifacts", "C:/artifacts2");11bp.artifactsFolder("C:/artifacts", "C:/artifacts2", "C:/artifacts3");12bp.artifactsFolder("C:/artifacts", "C:/artifacts2", "C:/artifacts3", "C:/artifacts4");13var bp = new BestPractices();14bp.artifactsFolder("C:/artifacts");15bp.artifactsFolder("C:/artifacts", "C:/artifacts2");16bp.artifactsFolder("C:/artifacts", "C:/artifacts2", "C:/artifacts3");17bp.artifactsFolder("C:/artifacts", "C:/artifacts2", "C:/artifacts3", "C:/artifacts4");18bp.artifactsFolder("C:/artifacts", "C:/artifacts2", "C:/artifacts3", "C:/artifacts4", "C:/artifacts5");19var bp = new BestPractices();20bp.artifactsFolder("C:/artifacts");21bp.artifactsFolder("C:/artifacts", "C:/artifacts2");22bp.artifactsFolder("C:/artifacts", "C:/artifacts2", "C:/artifacts3");23bp.artifactsFolder("C:/artifacts", "C:/artifacts2", "C:/artifacts3", "C:/artifacts4");24bp.artifactsFolder("C:/artifacts", "C:/

Full Screen

Using AI Code Generation

copy

Full Screen

1var bestPractice = require('best-practice');2var path = require('path');3var fs = require('fs');4var bp = new bestPractice();5var folderPath = path.join(__dirname, 'artifacts');6bp.artifactsFolder(folderPath, function(err) {7 if (err) {8 console.log('error in creating artifacts folder', err);9 } else {10 console.log('artifacts folder created');11 }12});13fs.exists(folderPath, function(exists) {14 if (exists) {15 console.log('artifacts folder exists');16 } else {17 console.log('artifacts folder does not exist');18 }19});20var bestPractice = require('best-practice');21var path = require('path');22var fs = require('fs');23var bp = new bestPractice();24var folderPath = path.join(__dirname, 'artifacts');25bp.artifactsFolder(folderPath, function(err) {26 if (err) {27 console.log('error in creating artifacts folder', err);28 } else {29 console.log('artifacts folder created');30 }31});32fs.exists(folderPath, function(exists) {33 if (exists) {34 console.log('artifacts folder exists');35 } else {36 console.log('artifacts folder does not exist');37 }38});39var bestPractice = require('best-practice');40var path = require('path');41var fs = require('fs');42var bp = new bestPractice();43var folderPath = path.join(__dirname, 'artifacts');44bp.artifactsFolder(folderPath, function(err) {45 if (err) {46 console.log('error in creating artifacts folder', err);47 } else {48 console.log('artifacts folder created');49 }50});51fs.exists(folderPath, function(exists) {52 if (exists) {53 console.log('artifacts folder exists');54 } else {55 console.log('artifacts folder does not exist');56 }57});

Full Screen

Using AI Code Generation

copy

Full Screen

1var BPA = require('./lib/bpa');2var bpa = new BPA();3bpa.artifactsFolder('./artifacts');4bpa.run(function(err, results) {5 if (err) {6 console.error(err);7 } else {8 console.log(results);9 }10});

Full Screen

Using AI Code Generation

copy

Full Screen

1var artifactsFolder = require('best-practice').artifactsFolder;2casper.test.begin('screenshot of current page', 1, function suite(test) {3 casper.capture(artifactsFolder('google.png'));4 test.assert(true);5 });6 casper.run(function() {7 test.done();8 });9});10MIT © [Alexandre Bento Freire](

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Best automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful