How to use file1 method in wpt

Best JavaScript code snippet using wpt

theme_test.js

Source:theme_test.js Github

copy

Full Screen

1/**2 * Licensed to the Apache Software Foundation (ASF) under one3 * or more contributor license agreements. See the NOTICE file4 * distributed with this work for additional information5 * regarding copyright ownership. The ASF licenses this file6 * to you under the Apache License, Version 2.0 (the7 * "License"); you may not use this file except in compliance8 * with the License. You may obtain a copy of the License at9 *10 * http://www.apache.org/licenses/LICENSE-2.011 *12 * Unless required by applicable law or agreed to in writing, software13 * distributed under the License is distributed on an "AS IS" BASIS,14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.15 * See the License for the specific language governing permissions and16 * limitations under the License.17 */18require('utils/configs/theme/theme');19describe('App.configTheme', function() {20 describe("#resolveConfigThemeConditions()", function () {21 beforeEach(function() {22 this.mockThemeCondition = sinon.stub(App.ThemeCondition, 'find');23 sinon.stub(App.configTheme, 'calculateConfigCondition').returns(true);24 this.mockId = sinon.stub(App.config, 'configId');25 sinon.stub(App.configTheme, 'getThemeResource').returns(Em.Object.create({26 configProperties: ['conf1']27 }));28 });29 afterEach(function() {30 this.mockId.restore();31 this.mockThemeCondition.restore();32 App.configTheme.calculateConfigCondition.restore();33 App.configTheme.getThemeResource.restore();34 });35 it("theme configs empty", function() {36 var configs = [Em.Object.create({37 name: 'conf1',38 filename: 'file1',39 hiddenBySection: false40 })];41 this.mockThemeCondition.returns([42 Em.Object.create({43 configs: []44 })45 ]);46 App.configTheme.resolveConfigThemeConditions(configs);47 expect(App.configTheme.calculateConfigCondition.called).to.be.false;48 expect(configs[0].get('hiddenBySection')).to.be.false;49 });50 it("theme resource is not 'config'", function() {51 var configs = [Em.Object.create({52 name: 'conf1',53 filename: 'file1',54 hiddenBySection: false55 })];56 this.mockThemeCondition.returns([57 Em.Object.create({58 configs: [{}],59 resource: ''60 })61 ]);62 App.configTheme.resolveConfigThemeConditions(configs);63 expect(App.configTheme.calculateConfigCondition.called).to.be.false;64 expect(configs[0].get('hiddenBySection')).to.be.false;65 });66 it("property_value_attributes is null", function() {67 var configs = [Em.Object.create({68 name: 'conf1',69 filename: 'file1',70 hiddenBySection: false71 })];72 this.mockThemeCondition.returns([73 Em.Object.create({74 configs: [{}],75 resource: 'config',76 then: {77 property_value_attributes: null78 },79 id: 'c1'80 })81 ]);82 App.configTheme.resolveConfigThemeConditions(configs);83 expect(App.configTheme.calculateConfigCondition.calledOnce).to.be.true;84 expect(App.configTheme.getThemeResource.called).to.be.false;85 expect(configs[0].get('hiddenBySection')).to.be.false;86 });87 it("property_value_attributes.visible is null", function() {88 var configs = [Em.Object.create({89 name: 'conf1',90 filename: 'file1',91 hiddenBySection: false92 })];93 this.mockThemeCondition.returns([94 Em.Object.create({95 configs: [{}],96 resource: 'config',97 then: {98 property_value_attributes: {99 visible: null100 }101 },102 id: 'c1'103 })104 ]);105 App.configTheme.resolveConfigThemeConditions(configs);106 expect(App.configTheme.calculateConfigCondition.calledOnce).to.be.true;107 expect(App.configTheme.getThemeResource.called).to.be.false;108 expect(configs[0].get('hiddenBySection')).to.be.false;109 });110 it("config not in the theme", function() {111 var configs = [Em.Object.create({112 name: 'conf1',113 filename: 'file1',114 hiddenBySection: false115 })];116 this.mockThemeCondition.returns([117 Em.Object.create({118 configs: [{}],119 resource: 'config',120 then: {121 property_value_attributes: {122 visible: true123 }124 },125 id: 'c1'126 })127 ]);128 this.mockId.returns('conf2');129 App.configTheme.resolveConfigThemeConditions(configs);130 expect(App.configTheme.calculateConfigCondition.calledOnce).to.be.true;131 expect(App.configTheme.getThemeResource.calledOnce).to.be.true;132 expect(configs[0].get('hiddenBySection')).to.be.false;133 });134 it("configCondition type is 'config' and hiddenBySection is true", function() {135 var configs = [Em.Object.create({136 name: 'conf1',137 filename: 'file1',138 hiddenBySection: true139 })];140 this.mockThemeCondition.returns([141 Em.Object.create({142 configs: [{}],143 resource: 'config',144 then: {145 property_value_attributes: {146 visible: true147 }148 },149 id: 'c1',150 type: 'config'151 })152 ]);153 this.mockId.returns('conf1');154 App.configTheme.resolveConfigThemeConditions(configs);155 expect(App.configTheme.calculateConfigCondition.calledOnce).to.be.true;156 expect(App.configTheme.getThemeResource.calledOnce).to.be.true;157 expect(configs[0].get('hiddenBySection')).to.be.true;158 });159 it("hiddenBySection should be true", function() {160 var configs = [Em.Object.create({161 name: 'conf1',162 filename: 'file1',163 hiddenBySection: false164 })];165 this.mockThemeCondition.returns([166 Em.Object.create({167 configs: [{}],168 resource: 'config',169 then: {170 property_value_attributes: {171 visible: false172 }173 },174 id: 'c1',175 type: 'config'176 })177 ]);178 this.mockId.returns('conf1');179 App.configTheme.resolveConfigThemeConditions(configs);180 expect(App.configTheme.calculateConfigCondition.calledOnce).to.be.true;181 expect(App.configTheme.getThemeResource.calledOnce).to.be.true;182 expect(configs[0].get('hiddenBySection')).to.be.true;183 });184 it("hiddenBySection should be false", function() {185 var configs = [Em.Object.create({186 name: 'conf1',187 filename: 'file1',188 hiddenBySection: true189 })];190 this.mockThemeCondition.returns([191 Em.Object.create({192 configs: [{}],193 resource: 'config',194 then: {195 property_value_attributes: {196 visible: true197 }198 },199 id: 'c1'200 })201 ]);202 this.mockId.returns('conf1');203 App.configTheme.resolveConfigThemeConditions(configs);204 expect(App.configTheme.calculateConfigCondition.calledOnce).to.be.true;205 expect(App.configTheme.getThemeResource.calledOnce).to.be.true;206 expect(configs[0].get('hiddenBySection')).to.be.false;207 });208 });209 describe("#getThemeResource()", function () {210 beforeEach(function() {211 sinon.stub(App.SubSection, 'find').returns([Em.Object.create({name: 'ss1'})]);212 sinon.stub(App.SubSectionTab, 'find').returns([Em.Object.create({name: 'sst1'})]);213 });214 afterEach(function() {215 App.SubSection.find.restore();216 App.SubSectionTab.find.restore();217 });218 it("configCondition with unknown type", function() {219 expect(App.configTheme.getThemeResource(Em.Object.create())).to.be.null;220 });221 it("configCondition with subsection type", function() {222 expect(App.configTheme.getThemeResource(Em.Object.create({223 name: 'ss1',224 type: 'subsection'225 }))).to.be.eql(Em.Object.create({name: 'ss1'}));226 });227 it("configCondition with subsectionTab type", function() {228 expect(App.configTheme.getThemeResource(Em.Object.create({229 name: 'sst1',230 type: 'subsectionTab'231 }))).to.be.eql(Em.Object.create({name: 'sst1'}));232 });233 it("configCondition with config type", function() {234 expect(App.configTheme.getThemeResource(Em.Object.create({235 configName: 'conf1',236 fileName: 'file1',237 type: 'config'238 }))).to.be.eql(Em.Object.create({239 configProperties: ['conf1__file1']240 }));241 });242 });243 describe("#getConfigThemeActions()", function () {244 beforeEach(function() {245 sinon.stub(App.configTheme, 'getConfigActions').returns([246 Em.Object.create({247 if: '',248 then: 'add',249 else: 'delete',250 hostComponent: 'C1'251 })252 ]);253 this.mock = sinon.stub(App.configTheme, 'calculateConfigCondition');254 });255 afterEach(function() {256 this.mock.restore();257 App.configTheme.getConfigActions.restore();258 });259 it("should add component", function() {260 this.mock.returns(true);261 expect(App.configTheme.getConfigThemeActions([], [])).to.be.eql({262 add: ['C1'],263 delete: []264 });265 });266 it("should delete component", function() {267 this.mock.returns(false);268 expect(App.configTheme.getConfigThemeActions([], [])).to.be.eql({269 add: [],270 delete: ['C1']271 });272 });273 });274 describe("#getConfigActions()", function () {275 beforeEach(function() {276 this.mock = sinon.stub(App.ConfigAction, 'find');277 });278 afterEach(function() {279 this.mock.restore();280 });281 it("action has empty configs", function() {282 this.mock.returns([283 Em.Object.create({284 configs: []285 })286 ]);287 expect(App.configTheme.getConfigActions([], [])).to.be.empty;288 });289 it("empty configs", function() {290 this.mock.returns([291 Em.Object.create({292 configs: [{293 fileName: 'file1',294 configName: 'conf1'295 }]296 })297 ]);298 expect(App.configTheme.getConfigActions([], [])).to.be.empty;299 });300 it("empty storedConfig, config not changed", function() {301 this.mock.returns([302 Em.Object.create({303 configs: [{304 fileName: 'file1',305 configName: 'conf1'306 }]307 })308 ]);309 var config = Em.Object.create({310 filename: 'file1',311 name: 'conf1',312 savedValue: 'val1',313 value: 'val1',314 recommendedValue: 'val1'315 });316 expect(App.configTheme.getConfigActions([config], [])).to.be.empty;317 });318 it("empty storedConfig, savedValue changed", function() {319 this.mock.returns([320 Em.Object.create({321 configs: [{322 fileName: 'file1',323 configName: 'conf1'324 }]325 })326 ]);327 var config = Em.Object.create({328 filename: 'file1',329 name: 'conf1',330 savedValue: 'val1',331 value: 'val2',332 recommendedValue: 'val1'333 });334 expect(App.configTheme.getConfigActions([config], [])).to.be.eql([Em.Object.create({335 configs: [{336 fileName: 'file1',337 configName: 'conf1'338 }]339 })]);340 });341 it("empty storedConfig, recommendedValue changed", function() {342 this.mock.returns([343 Em.Object.create({344 configs: [{345 fileName: 'file1',346 configName: 'conf1'347 }]348 })349 ]);350 var config = Em.Object.create({351 filename: 'file1',352 name: 'conf1',353 value: 'val2',354 recommendedValue: 'val1'355 });356 expect(App.configTheme.getConfigActions([config], [])).to.be.eql([Em.Object.create({357 configs: [{358 fileName: 'file1',359 configName: 'conf1'360 }]361 })]);362 });363 it("storedConfig not changed", function() {364 this.mock.returns([365 Em.Object.create({366 configs: [{367 fileName: 'file1',368 configName: 'conf1'369 }]370 })371 ]);372 var config = Em.Object.create({373 filename: 'file1',374 name: 'conf1',375 savedValue: 'val1',376 value: 'val1',377 recommendedValue: 'val1'378 });379 var storedConfig = {380 filename: 'file1',381 name: 'conf1',382 value: 'val1'383 };384 expect(App.configTheme.getConfigActions([config], [storedConfig])).to.be.empty;385 });386 it("storedConfig changed", function() {387 this.mock.returns([388 Em.Object.create({389 configs: [{390 fileName: 'file1',391 configName: 'conf1'392 }]393 })394 ]);395 var config = Em.Object.create({396 filename: 'file1',397 name: 'conf1',398 savedValue: 'val1',399 value: 'val1',400 recommendedValue: 'val1'401 });402 var storedConfig = {403 filename: 'file1',404 name: 'conf1',405 value: 'val2'406 };407 expect(App.configTheme.getConfigActions([config], [storedConfig])).to.be.eql([Em.Object.create({408 configs: [{409 fileName: 'file1',410 configName: 'conf1'411 }]412 })]);413 });414 });415 describe("#calculateConfigCondition()", function () {416 var testCases = [417 {418 ifStatement: "${file1/conf1}",419 serviceConfigs: [],420 expected: false421 },422 {423 ifStatement: "${file1/conf1}",424 serviceConfigs: [Em.Object.create({425 filename: 'file1.xml',426 name: 'conf1',427 value: 'true'428 })],429 expected: true430 },431 {432 ifStatement: "${file1/conf1}&&${file1/conf2}",433 serviceConfigs: [434 Em.Object.create({435 filename: 'file1.xml',436 name: 'conf1',437 value: 'true'438 }),439 Em.Object.create({440 filename: 'file1.xml',441 name: 'conf2',442 value: 'true'443 })444 ],445 expected: true446 },447 {448 ifStatement: "${file1/conf1}&&${file1/conf2}",449 serviceConfigs: [450 Em.Object.create({451 filename: 'file1.xml',452 name: 'conf1',453 value: 'false'454 }),455 Em.Object.create({456 filename: 'file1.xml',457 name: 'conf2',458 value: 'false'459 })460 ],461 expected: false462 },463 {464 ifStatement: "${file1/conf1}&&${file1/conf2}===false",465 serviceConfigs: [466 Em.Object.create({467 filename: 'file1.xml',468 name: 'conf1',469 value: 'true'470 }),471 Em.Object.create({472 filename: 'file1.xml',473 name: 'conf2',474 value: 'false'475 })476 ],477 expected: true478 },479 {480 ifStatement: "${file1/conf1}&&${file1/conf2}",481 serviceConfigs: [482 Em.Object.create({483 filename: 'file1.xml',484 name: 'conf1',485 value: 'true'486 }),487 Em.Object.create({488 filename: 'file1.xml',489 name: 'conf2',490 value: 'false'491 })492 ],493 expected: false494 },495 {496 ifStatement: "${file1/conf1}===false&&${file1/conf2}===false",497 serviceConfigs: [498 Em.Object.create({499 filename: 'file1.xml',500 name: 'conf1',501 value: 'false'502 }),503 Em.Object.create({504 filename: 'file1.xml',505 name: 'conf2',506 value: 'false'507 })508 ],509 expected: true510 },511 {512 ifStatement: "${file1/conf1}||${file1/conf2}",513 serviceConfigs: [514 Em.Object.create({515 filename: 'file1.xml',516 name: 'conf1',517 value: 'true'518 }),519 Em.Object.create({520 filename: 'file1.xml',521 name: 'conf2',522 value: 'true'523 })524 ],525 expected: true526 },527 {528 ifStatement: "${file1/conf1}||${file1/conf2}",529 serviceConfigs: [530 Em.Object.create({531 filename: 'file1.xml',532 name: 'conf1',533 value: 'false'534 }),535 Em.Object.create({536 filename: 'file1.xml',537 name: 'conf2',538 value: 'true'539 })540 ],541 expected: true542 },543 {544 ifStatement: "${file1/conf1}||${file1/conf2}",545 serviceConfigs: [546 Em.Object.create({547 filename: 'file1.xml',548 name: 'conf1',549 value: 'true'550 }),551 Em.Object.create({552 filename: 'file1.xml',553 name: 'conf2',554 value: 'false'555 })556 ],557 expected: true558 },559 {560 ifStatement: "${file1/conf1}||${file1/conf2}",561 serviceConfigs: [562 Em.Object.create({563 filename: 'file1.xml',564 name: 'conf1',565 value: 'false'566 }),567 Em.Object.create({568 filename: 'file1.xml',569 name: 'conf2',570 value: 'false'571 })572 ],573 expected: false574 }575 ];576 testCases.forEach(function(test) {577 it("ifStatement: " + test.ifStatement +578 "serviceConfigs: " + JSON.stringify(test.serviceConfigs), function() {579 expect(App.configTheme.calculateConfigCondition(test.ifStatement, test.serviceConfigs)).to.be.equal(test.expected);580 });581 });582 });...

Full Screen

Full Screen

spec.git-api.conflict.js

Source:spec.git-api.conflict.js Github

copy

Full Screen

1const expect = require('expect.js');2const request = require('supertest');3const express = require('express');4const path = require('path');5const restGit = require('../source/git-api');6const common = require('./common-es6.js');7const app = express();8app.use(require('body-parser').json());9restGit.registerApi({ app: app, config: { dev: true, autoStashAndPop: true } });10let testDir;11const req = request(app);12describe('git-api conflict rebase', function () {13 const commitMessage = 'Commit 1';14 const testFile1 = 'testfile1.txt';15 const testBranch = 'testBranch';16 before(() => {17 return common.initRepo(req).then((dir) => {18 testDir = dir;19 return common20 .post(req, '/testing/createfile', { file: path.join(testDir, testFile1) })21 .then(() =>22 common.post(req, '/commit', {23 path: testDir,24 message: commitMessage,25 files: [{ name: testFile1 }],26 })27 )28 .then(() =>29 common.post(req, '/branches', { path: testDir, name: testBranch, startPoint: 'master' })30 )31 .then(() =>32 common.post(req, '/testing/changefile', { file: path.join(testDir, testFile1) })33 )34 .then(() =>35 common.post(req, '/commit', {36 path: testDir,37 message: commitMessage,38 files: [{ name: testFile1 }],39 })40 )41 .then(() => common.post(req, '/checkout', { path: testDir, name: testBranch }))42 .then(() =>43 common.post(req, '/testing/changefile', { file: path.join(testDir, testFile1) })44 )45 .then(() =>46 common.post(req, '/commit', {47 path: testDir,48 message: commitMessage,49 files: [{ name: testFile1 }],50 })51 );52 });53 });54 it('should be possible to rebase on master', (done) => {55 req56 .post(`${restGit.pathPrefix}/rebase`)57 .send({ path: testDir, onto: 'master' })58 .set('Accept', 'application/json')59 .expect('Content-Type', /json/)60 .expect(400)61 .end((err, res) => {62 expect(res.body.errorCode).to.be('merge-failed');63 done();64 });65 });66 it('status should list files in conflict', () => {67 return common.get(req, '/status', { path: testDir }).then((res) => {68 expect(res.inRebase).to.be(true);69 expect(Object.keys(res.files).length).to.be(1);70 expect(res.files[testFile1]).to.eql({71 displayName: testFile1,72 fileName: testFile1,73 oldFileName: testFile1,74 isNew: false,75 staged: false,76 removed: false,77 conflict: true,78 renamed: false,79 type: 'text',80 additions: '4',81 deletions: '0',82 });83 });84 });85 it('should be possible fix the conflict', () => {86 return common.post(req, '/testing/changefile', { file: path.join(testDir, testFile1) });87 });88 it('should be possible to resolve', () => {89 return common.post(req, '/resolveconflicts', { path: testDir, files: [testFile1] });90 });91 it('should be possible continue the rebase', () => {92 return common.post(req, '/rebase/continue', { path: testDir });93 });94});95describe('git-api conflict checkout', function () {96 const testBranch = 'testBranch';97 const testFile1 = 'testfile1.txt';98 before(() => {99 return common.initRepo(req).then((dir) => {100 testDir = dir;101 return common102 .post(req, '/testing/createfile', { file: path.join(testDir, testFile1) })103 .then(() =>104 common.post(req, '/commit', { path: testDir, message: 'a', files: [{ name: testFile1 }] })105 )106 .then(() =>107 common.post(req, '/branches', { path: testDir, name: testBranch, startPoint: 'master' })108 )109 .then(() =>110 common.post(req, '/testing/changefile', { file: path.join(testDir, testFile1) })111 )112 .then(() =>113 common.post(req, '/commit', { path: testDir, message: 'b', files: [{ name: testFile1 }] })114 );115 });116 });117 it('should be possible to make some changes', () => {118 return common.post(req, '/testing/changefile', { file: path.join(testDir, testFile1) });119 });120 it('should be possible to checkout with local files that will conflict', (done) => {121 req122 .post(`${restGit.pathPrefix}/checkout`)123 .send({ path: testDir, name: testBranch })124 .set('Accept', 'application/json')125 .expect('Content-Type', /json/)126 .expect(400)127 .end((err, res) => {128 expect(res.body.errorCode).to.be('merge-failed');129 done();130 });131 });132 it('status should list files in conflict', () => {133 return common.get(req, '/status', { path: testDir }).then((res) => {134 expect(res.inRebase).to.be(false);135 expect(Object.keys(res.files).length).to.be(1);136 expect(res.files[testFile1]).to.eql({137 displayName: testFile1,138 fileName: testFile1,139 oldFileName: testFile1,140 isNew: false,141 staged: false,142 removed: false,143 conflict: true,144 renamed: false,145 type: 'text',146 additions: '4',147 deletions: '0',148 });149 });150 });151});152describe('git-api conflict merge', function () {153 const testBranch = 'testBranch1';154 const testFile1 = 'testfile1.txt';155 before(() => {156 return common.initRepo(req).then((dir) => {157 testDir = dir;158 return common159 .post(req, '/testing/createfile', { file: path.join(testDir, testFile1) })160 .then(() =>161 common.post(req, '/commit', { path: testDir, message: 'a', files: [{ name: testFile1 }] })162 )163 .then(() =>164 common.post(req, '/branches', { path: testDir, name: testBranch, startPoint: 'master' })165 )166 .then(() =>167 common.post(req, '/testing/changefile', { file: path.join(testDir, testFile1) })168 )169 .then(() =>170 common.post(req, '/commit', { path: testDir, message: 'b', files: [{ name: testFile1 }] })171 )172 .then(() => common.post(req, '/checkout', { path: testDir, name: testBranch }))173 .then(() =>174 common.post(req, '/testing/changefile', { file: path.join(testDir, testFile1) })175 )176 .then(() =>177 common.post(req, '/commit', { path: testDir, message: 'c', files: [{ name: testFile1 }] })178 );179 });180 });181 it('should be possible to merge the branches', (done) => {182 req183 .post(`${restGit.pathPrefix}/merge`)184 .send({ path: testDir, with: 'master' })185 .set('Accept', 'application/json')186 .expect('Content-Type', /json/)187 .expect(400)188 .end((err, res) => {189 expect(res.body.errorCode).to.be('merge-failed');190 done();191 });192 });193 it('status should list files in conflict', () => {194 return common.get(req, '/status', { path: testDir }).then((res) => {195 expect(res.inMerge).to.be(true);196 expect(res.commitMessage).to.be.ok();197 expect(Object.keys(res.files).length).to.be(1);198 expect(res.files[testFile1]).to.eql({199 displayName: testFile1,200 fileName: testFile1,201 oldFileName: testFile1,202 isNew: false,203 staged: false,204 removed: false,205 conflict: true,206 renamed: false,207 type: 'text',208 additions: '4',209 deletions: '0',210 });211 });212 });213 it('should be possible fix the conflict', () => {214 return common.post(req, '/testing/changefile', { file: path.join(testDir, testFile1) });215 });216 it('should be possible to resolve', () => {217 return common.post(req, '/resolveconflicts', { path: testDir, files: [testFile1] });218 });219 it('should be possible continue the merge', () => {220 return common.post(req, '/merge/continue', { path: testDir, message: 'something' });221 });222 it('log should show changes on the merge commit', () => {223 return common.get(req, '/gitlog', { path: testDir }).then((res) => {224 expect(res.nodes).to.be.a('array');225 expect(res.nodes.length).to.be(4);226 expect(res.nodes[0].additions).to.eql(1);227 expect(res.nodes[0].deletions).to.eql(1);228 expect(res.nodes[0].fileLineDiffs.length).to.be(1);229 expect(res.nodes[0].fileLineDiffs[0]).to.eql({230 additions: 1,231 deletions: 1,232 fileName: testFile1,233 oldFileName: testFile1,234 displayName: testFile1,235 type: 'text',236 });237 });238 });239});240describe('git-api conflict solve by deleting', function () {241 const commitMessage = 'Commit 1';242 const testFile1 = 'testfile1.txt';243 const testBranch = 'testBranch';244 before(() => {245 return common.initRepo(req).then((dir) => {246 testDir = dir;247 return common248 .post(req, '/testing/createfile', { file: path.join(testDir, testFile1) })249 .then(() =>250 common.post(req, '/commit', {251 path: testDir,252 message: commitMessage,253 files: [{ name: testFile1 }],254 })255 )256 .then(() =>257 common.post(req, '/branches', { path: testDir, name: testBranch, startPoint: 'master' })258 )259 .then(() =>260 common.post(req, '/testing/changefile', { file: path.join(testDir, testFile1) })261 )262 .then(() =>263 common.post(req, '/commit', {264 path: testDir,265 message: commitMessage,266 files: [{ name: testFile1 }],267 })268 )269 .then(() => common.post(req, '/checkout', { path: testDir, name: testBranch }))270 .then(() =>271 common.post(req, '/testing/changefile', { file: path.join(testDir, testFile1) })272 )273 .then(() =>274 common.post(req, '/commit', {275 path: testDir,276 message: commitMessage,277 files: [{ name: testFile1 }],278 })279 );280 });281 });282 it('should be possible to rebase on master', (done) => {283 req284 .post(`${restGit.pathPrefix}/rebase`)285 .send({ path: testDir, onto: 'master' })286 .set('Accept', 'application/json')287 .expect('Content-Type', /json/)288 .expect(400)289 .end((err, res) => {290 expect(res.body.errorCode).to.be('merge-failed');291 done();292 });293 });294 it('status should list files in conflict', () => {295 return common.get(req, '/status', { path: testDir }).then((res) => {296 expect(res.inRebase).to.be(true);297 expect(Object.keys(res.files).length).to.be(1);298 expect(res.files[testFile1]).to.eql({299 displayName: testFile1,300 fileName: testFile1,301 oldFileName: testFile1,302 isNew: false,303 staged: false,304 removed: false,305 conflict: true,306 renamed: false,307 type: 'text',308 additions: '4',309 deletions: '0',310 });311 });312 });313 it('should be possible to remove the file', () => {314 return common.post(req, '/testing/removefile', { file: path.join(testDir, testFile1) });315 });316 it('should be possible to resolve', () => {317 return common.post(req, '/resolveconflicts', { path: testDir, files: [testFile1] });318 });319 it('should be possible continue the rebase', () => {320 return common.post(req, '/rebase/continue', { path: testDir });321 });322 after(() => {323 return common.post(req, '/testing/cleanup', undefined);324 });...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('./wpt.js');2wpt.file1();3var wpt = require('./wpt.js');4wpt.file2();5var wpt = require('./wpt.js');6wpt.file3();7var wpt = require('./wpt.js');8wpt.file4();9var wpt = require('./wpt.js');10wpt.file5();11var wpt = require('./wpt.js');12wpt.file6();13var wpt = require('./wpt.js');14wpt.file7();15var wpt = require('./wpt.js');16wpt.file8();17var wpt = require('./wpt.js');18wpt.file9();19var wpt = require('./wpt.js');20wpt.file10();21var wpt = require('./wpt.js');22wpt.file11();23var wpt = require('./wpt.js');24wpt.file12();25var wpt = require('./wpt.js');26wpt.file13();27var wpt = require('./wpt.js');28wpt.file14();29var wpt = require('./wpt.js');30wpt.file15();

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('./wpt.js');2wpt.file1();3var wpt = require('./wpt.js');4wpt.file2();5var wpt = require('./wpt.js');6wpt.file3();7var wpt = require('./wpt.js');8wpt.file4();9var wpt = require('./wpt.js');10wpt.file5();11var wpt = require('./wpt.js');12wpt.file6();13var wpt = require('./wpt.js');14wpt.file7();15var wpt = require('./wpt.js');16wpt.file8();17var wpt = require('./wpt.js');18wpt.file9();19var wpt = require('./wpt.js');20wpt.file10();21var wpt = require('./wpt.js');22wpt.file11();23var wpt = require('./wpt.js');24wpt.file12();25var wpt = require('./wpt.js');26wpt.file13();27var wpt = require('./wpt.js');28wpt.file14();29var wpt = require('./wpt.js');30wpt.file15();31var wpt = require('./wpt.js');32wpt.file16();33var wpt = require('./wpt.js');34wpt.file17();35var wpt = require('./wpt.js');36wpt.file18();37var wpt = require('./wpt.js');

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('./file1.js');2wpt.file1Method();3var wpt = require('./file2.js');4exports.file1Method = function() {5 console.log('file1 method');6 wpt.file2Method();7};8exports.file2Method = function() {9 console.log('file2 method');10};

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('./wpt.js');2console.log(wpt.file1());3module.exports = {4 file1: function(){5 return "file1";6 }7}

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('./wpt.js');2wpt.file1("hello world");3wpt.file2("hello world");4module.exports.file1 = function(data){5 console.log("file1: "+data);6}7module.exports.file2 = function(data){8 console.log("file2: "+data);9}

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('./wpt');2wpt.file1();3exports.file1 = function(){4 console.log("file1");5}6exports.file2 = function(){7 console.log("file2");8}

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('wpt');2wpt.file1('file1', function(err, result) {3 if(err) {4 console.log(err);5 } else {6 console.log(result);7 }8});9wpt.file2('file2', function(err, result) {10 if(err) {11 console.log(err);12 } else {13 console.log(result);14 }15});16wpt.file3('file3', function(err, result) {17 if(err) {18 console.log(err);19 } else {20 console.log(result);21 }22});23wpt.file4('file4', function(err, result) {24 if(err) {25 console.log(err);26 } else {27 console.log(result);28 }29});30wpt.file5('file5', function(err, result) {31 if(err) {32 console.log(err);33 } else {34 console.log(result);35 }36});37wpt.file6('file6', function(err, result) {38 if(err) {39 console.log(err);40 } else {41 console.log(result);42 }43});44wpt.file7('file7', function(err, result) {45 if(err) {46 console.log(err);47 } else {48 console.log(result);49 }50});51wpt.file8('file8', function(err, result) {52 if(err) {53 console.log(err);54 } else {55 console.log(result);56 }57});58wpt.file9('file9', function(err, result) {59 if(err) {60 console.log(err);61 } else {62 console.log(result);63 }64});65wpt.file10('file10', function(err, result) {66 if(err) {67 console.log(err);68 } else {69 console.log(result);70 }71});72wpt.file11('file11',

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 wpt 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