How to use Pending method in Mocha

Best JavaScript code snippet using mocha

Run Mocha automation tests on LambdaTest cloud grid

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

pendingactions.js

Source: pendingactions.js Github

copy
1/**
2 * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
3 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4 */
5
6import VirtualTestEditor from './_utils/virtualtesteditor';
7import PendingActions from '../src/pendingactions';
8import { expectToThrowCKEditorError } from '@ckeditor/ckeditor5-utils/tests/_utils/utils';
9
10let editor, pendingActions;
11
12describe( 'PendingActions', () => {
13	beforeEach( () => {
14		return VirtualTestEditor.create( {
15			plugins: [ PendingActions ]
16		} ).then( newEditor => {
17			editor = newEditor;
18			pendingActions = editor.plugins.get( PendingActions );
19		} );
20	} );
21
22	afterEach( () => {
23		return editor.destroy();
24	} );
25
26	it( 'should define static pluginName property', () => {
27		expect( PendingActions ).to.have.property( 'pluginName', 'PendingActions' );
28	} );
29
30	it( 'should be marked as a context plugin', () => {
31		expect( PendingActions.isContextPlugin ).to.true;
32	} );
33
34	describe( 'init()', () => {
35		it( 'should have hasAny observable', () => {
36			const spy = sinon.spy();
37
38			pendingActions.on( 'change:hasAny', spy );
39
40			expect( pendingActions ).to.have.property( 'hasAny', false );
41
42			pendingActions.hasAny = true;
43
44			sinon.assert.calledOnce( spy );
45		} );
46	} );
47
48	describe( 'add()', () => {
49		it( 'should register and return pending action', () => {
50			const action = pendingActions.add( 'Action' );
51
52			expect( action ).be.an( 'object' );
53			expect( action.message ).to.equal( 'Action' );
54		} );
55
56		it( 'should return observable', () => {
57			const spy = sinon.spy();
58			const action = pendingActions.add( 'Action' );
59
60			action.on( 'change:message', spy );
61
62			action.message = 'New message';
63
64			sinon.assert.calledOnce( spy );
65		} );
66
67		it( 'should update hasAny observable', () => {
68			expect( pendingActions ).to.have.property( 'hasAny', false );
69
70			pendingActions.add( 'Action' );
71
72			expect( pendingActions ).to.have.property( 'hasAny', true );
73		} );
74
75		it( 'should throw an error when invalid message is given', () => {
76			expectToThrowCKEditorError( () => {
77				pendingActions.add( {} );
78			}, /^pendingactions-add-invalid-message/, editor );
79		} );
80
81		it( 'should fire add event with added item', () => {
82			const spy = sinon.spy();
83
84			pendingActions.on( 'add', spy );
85
86			const action = pendingActions.add( 'Some action' );
87
88			sinon.assert.calledWith( spy, sinon.match.any, action );
89		} );
90	} );
91
92	describe( 'remove()', () => {
93		it( 'should remove given pending action and update observable', () => {
94			const action1 = pendingActions.add( 'Action 1' );
95			const action2 = pendingActions.add( 'Action 2' );
96
97			expect( pendingActions ).to.have.property( 'hasAny', true );
98
99			pendingActions.remove( action1 );
100
101			expect( pendingActions ).to.have.property( 'hasAny', true );
102
103			pendingActions.remove( action2 );
104
105			expect( pendingActions ).to.have.property( 'hasAny', false );
106		} );
107
108		it( 'should fire remove event with removed item', () => {
109			const spy = sinon.spy();
110
111			pendingActions.on( 'remove', spy );
112
113			const action = pendingActions.add( 'Some action' );
114
115			pendingActions.remove( action );
116
117			sinon.assert.calledWith( spy, sinon.match.any, action );
118		} );
119	} );
120
121	describe( 'first', () => {
122		it( 'should return first pending action from the list', () => {
123			expect( pendingActions.first ).to.be.null;
124
125			const action = pendingActions.add( 'Action 1' );
126
127			pendingActions.add( 'Action 2' );
128
129			expect( pendingActions.first ).to.equal( action );
130		} );
131	} );
132
133	describe( 'iterator', () => {
134		it( 'should return all panding actions', () => {
135			pendingActions.add( 'Action 1' );
136			pendingActions.add( 'Action 2' );
137
138			expect( Array.from( pendingActions, action => action.message ) ).to.have.members( [ 'Action 1', 'Action 2' ] );
139		} );
140	} );
141} );
142
Full Screen

pendingSignForms.js

Source: pendingSignForms.js Github

copy
1/*************************************************************************
2 *
3 * ADOBE CONFIDENTIAL
4 * ___________________
5 *
6 *  Copyright 2014 Adobe Systems Incorporated
7 *  All Rights Reserved.
8 *
9 * NOTICE:  All information contained herein is, and remains
10 * the property of Adobe Systems Incorporated and its suppliers,
11 * if any.  The intellectual and technical concepts contained
12 * herein are proprietary to Adobe Systems Incorporated and its
13 * suppliers and are protected by trade secret or copyright law.
14 * Dissemination of this information or reproduction of this material
15 * is strictly forbidden unless prior written permission is obtained
16 * from Adobe Systems Incorporated.
17 **************************************************************************/
18
19(function(document, $) {
20    var pendingSignGuidePanelMaxHeight = null, pageCount = 1, pendingSignToShow, responsePendingSignGlobal, totalResult = $("#tabs").data("totalresults"),cutPoints=[];
21    var pendingSignTemplateString = $("#pendingSignCustomTemplate").html().split('&quote;').join('\"');
22    for(var i = 1; i< pendingSignTemplateString.replace(/[\r\t\n]/g, " ").split("\${").length;i++) {
23        cutPoints.push((pendingSignTemplateString.replace(/[\r\t\n]/g, " ").split("\${")[i].split("}")[0]));
24    }
25    var reqCutPoints =  jQuery.unique(cutPoints.toString().split(",")).toString();
26    var servletPath = $("#tabs").data("servletpath");
27    var urlToGetPendingSign = Granite.HTTP.externalize(servletPath + ".fp.draft.json?func=getPendingSignInstances");
28	var urlToCancelPendingSign = Granite.HTTP.externalize(servletPath + ".fp.draft.json?func=cancelAgreement");
29
30    var getPendingSignForms = function(){
31        $.ajax({
32            type: "GET",
33            url: urlToGetPendingSign,
34            dataType: "json",
35            cache: false,
36            data:{
37                cutPoints:reqCutPoints
38            },
39            success: function(response) {
40                responsePendingSignGlobal = response.reverse();
41                pendingSignToShow = responsePendingSignGlobal;
42                $("#pendingSignFormsTitle").text($("#pendingSignFormsTitle").data("pendingsignformstitle")+"("+(responsePendingSignGlobal.length) + ")");
43                checkForPendingSignView();
44            },
45            error:function(){
46            }
47        });
48    };
49
50    $("#morePendingSignForm").click(function() {
51        showMorePendingSignForms(pendingSignToShow,pageCount);
52    });
53
54    $("#morePendingSignForm").keypress(function(e) {
55        var eventCode = e.keyCode || e.charCode || e.which;
56        if (eventCode == 13 || eventCode == 32) {
57            showMorePendingSignForms(pendingSignToShow, pageCount);
58        }
59    });
60
61    var showPendingSignForms = function(){
62        var pendingSignTextSearchBox = $("#pendingSignTextSearchBox");
63        pendingSignTextSearchBox.val("");
64        pendingSignTextSearchBox.keyup();
65        $("#pendingSignLister").css("display","block");
66    };
67
68    $("#pendingSignTextSearchBox").keyup(function(){
69        pageCount = 1;
70        if($("#pendingSignTextSearchBox").val())
71            $("#morePendingSignForm").hide();
72        else
73            $("#morePendingSignForm").show();
74        pendingSignToShow = responsePendingSignGlobal.filter(function(item){ return item.name.toLowerCase().search($("#pendingSignTextSearchBox").val().trim().replace(/ +(?= )/g,'').toLowerCase()) >= 0;});
75        showFirstPendingSignFormsPage(pendingSignToShow);
76    });
77
78    var showMorePendingSignForms = function(response,pageNumber){
79        var pendingSignPanel = $("._FP_pendingSignFormPanel");
80        if(pendingSignGuidePanelMaxHeight == null){
81            pendingSignGuidePanelMaxHeight = pendingSignPanel.height()+parseInt(pendingSignPanel.css("border-top-width"))+parseInt(pendingSignPanel.css("border-bottom-width"));
82            pendingSignPanel.css("max-height",pendingSignGuidePanelMaxHeight);
83        }
84        var customTemplate = $.parseHTML($("#pendingSignCustomTemplate").html());
85        var totalPendingSignForms = response.length, i = (pageNumber-1)*totalResult, j= 0, morePendingSignForms = $("#morePendingSignForm");
86        var totalRepeatable = $(customTemplate).find("[data-repeatable=true]").length;
87        var customTemplateParent =  $(customTemplate).wrap("<div class='testDiv'></div>").parent();
88        var totalRepeatable = $(customTemplateParent).find("[data-repeatable=true]").length;
89        var templateToAppend = "";
90        while(totalRepeatable--){
91            var currentTemplateObj = $($(customTemplateParent).find("[data-repeatable=true]")[totalRepeatable]);
92            $(currentTemplateObj).wrap("<div class='currentTemplateParent'></div>");
93            var currentTemplateParent = $(currentTemplateObj).parent();
94            var currentTemplate = currentTemplateParent.html();
95            while(i<totalPendingSignForms && j++ <totalResult ){
96                var time = isNaN(new Date(response[i]["jcr:lastModified"])) ? new Date(parseInt(response[i]["jcr:lastModified"])) : new Date(response[i]["jcr:lastModified"]);
97                var currentTime = new Date();
98                var diffTime = milliSecondsToString(currentTime - time);
99                var iconClass = "__FP_iconClass" + i%6;
100                var name = response[i].name;
101                var firstLetter = name.substring(0,1);
102                var desc = response[i].description;
103                if(!desc)
104                    desc = "";
105                response[i].path = Granite.HTTP.externalize(response[i].path);
106                var contextPath = Granite.HTTP.externalize("/");
107                response[i].contextPath = contextPath.substring(0,contextPath.length-1);
108                var pendingSignID = response[i].pendingSignID;
109                time.today();
110                time.timeNow();
111                response[i].Today = time.Today;
112                response[i].TimeNow = time.TimeNow;
113                response[i].diffTime = diffTime;
114                response[i].iconClass = iconClass;
115                response[i].firstLetter = firstLetter.toUpperCase();
116                response[i].description = desc;
117                response[i].renderPath = Granite.HTTP.externalize(response[i]["renderPath"] ? response[i]["renderPath"] : response[i]["path"]);
118                var oldUnderscoreTemplateSetting = _.templateSettings.interpolate;
119                var oldUnderscoreTemplateEscapeSetting = _.templateSettings.escape;
120                _.templateSettings.interpolate = /\$\{(.+?)\}/g;
121                _.templateSettings.escape = /\$\{(.+?)\}/g;
122                templateToAppend += _.template(currentTemplate,response[i]);
123                _.templateSettings.interpolate = oldUnderscoreTemplateSetting;
124                _.templateSettings.escape = oldUnderscoreTemplateEscapeSetting;
125                i++;
126            }
127        }
128        $($("#__FP_appendPendingSign").find("[data-repeatable]").last().parent()).append(templateToAppend);
129        if(totalPendingSignForms < (pageNumber)*totalResult+1){
130            morePendingSignForms.hide();
131        }
132        else{
133            morePendingSignForms.show();
134            pageCount++;
135        }
136    };
137
138    var showFirstPendingSignFormsPage = function(response){
139        var customTemplate = $.parseHTML($("#pendingSignCustomTemplate").html());
140        var morePendingSignForms = $("#morePendingSignForm");
141        $("#__FP_appendPendingSign").empty();
142        var customTemplateParent =  $(customTemplate).wrap("<div class='testDiv'></div>").parent();
143        var totalRepeatable = $(customTemplateParent).find("[data-repeatable=true]").length;
144        while(totalRepeatable--){
145            var currentTemplateObj = $($(customTemplateParent).find("[data-repeatable=true]")[totalRepeatable]);
146            $(currentTemplateObj).wrap("<div class='currentTemplateParent'></div>");
147            var currentTemplateParent = $(currentTemplateObj).parent();
148            var currentTemplate = currentTemplateParent.html();
149            var templateToAppend = "";
150            for(var i=0;i<response.length&&i<totalResult;i++){
151                var time = isNaN(new Date(response[i]["jcr:lastModified"])) ? new Date(parseInt(response[i]["jcr:lastModified"])) : new Date(response[i]["jcr:lastModified"]);
152                var currentTime = new Date();
153                var diffTime = milliSecondsToString(currentTime - time);
154                var iconClass = "__FP_iconClass" + i%6;
155                var name = response[i].name;
156                var firstLetter = name.substring(0,1);
157                var desc = response[i].description;
158                if(!desc)
159                    desc = "";
160                response[i].path = Granite.HTTP.externalize(response[i].path);
161                var contextPath = Granite.HTTP.externalize("/");
162                response[i].contextPath = contextPath.substring(0,contextPath.length-1);
163                var pendingSignID = response[i].pendingSignID;
164                time.today();
165                time.timeNow();
166                response[i].Today = time.Today;
167                response[i].TimeNow = time.TimeNow;
168                response[i].diffTime = diffTime;
169                response[i].iconClass = iconClass;
170                response[i].firstLetter = firstLetter.toUpperCase();
171                response[i].description = desc;
172                response[i].renderPath = Granite.HTTP.externalize(response[i]["renderPath"] ? response[i]["renderPath"] : response[i]["path"]);
173                var oldUnderscoreTemplateSetting = _.templateSettings.interpolate;
174                var oldUnderscoreTemplateEscapeSetting = _.templateSettings.escape;
175                _.templateSettings.interpolate = /\$\{(.+?)\}/g;
176                _.templateSettings.escape = /\$\{(.+?)\}/g;
177                templateToAppend += _.template(currentTemplate,response[i]);
178                _.templateSettings.interpolate = oldUnderscoreTemplateSetting;
179                _.templateSettings.escape = oldUnderscoreTemplateEscapeSetting;
180            }
181            $(customTemplateParent.find(".currentTemplateParent")).replaceWith(templateToAppend);
182        }
183        $("#__FP_appendPendingSign").append(($(customTemplateParent).clone()).html());
184        if(response.length <= totalResult){
185            morePendingSignForms.hide();
186        }
187        else{
188            morePendingSignForms.show();
189            pageCount++;
190        }
191    };
192
193    openPendingSignForm = function(e){
194        var path = $(e).attr('path');
195        var name = $(e).attr('title');
196        var formTarget = (path)+".html";
197        window.open(formTarget);
198    };
199
200    var checkForPendingSignView = function() {
201        if(responsePendingSignGlobal.length == 0){
202            $("#__FP_appendPendingSign").empty();
203            $("#pendingSignTextSearchBox").hide();
204            return;
205        }
206        showPendingSignForms();
207    };
208
209    var milliSecondsToString = function(milliSeconds){
210        window.FD.FP.Util.setLocale($("#tabs").data("locale"));
211        var seconds = parseInt(milliSeconds/1000);
212        var numyears = Math.floor(seconds / 31536000);
213        var numdays = Math.floor((seconds % 31536000) / 86400);
214        var numhours = Math.floor(((seconds % 31536000) % 86400) / 3600);
215        var numminutes = Math.floor((((seconds % 31536000) % 86400) % 3600) / 60);
216        var numseconds = (((seconds % 31536000) % 86400) % 3600) % 60;
217        var yearText   = window.FD.FP.Util.getLocalizedValue(" Years "),
218            daysText   = window.FD.FP.Util.getLocalizedValue(" Days "),
219            hourText   = window.FD.FP.Util.getLocalizedValue(" Hour "),
220            minText    = window.FD.FP.Util.getLocalizedValue(" Minutes "),
221            secText    = window.FD.FP.Util.getLocalizedValue(" Seconds "),
222            oneMinText = window.FD.FP.Util.getLocalizedValue(" Minute "),
223            agoText    = window.FD.FP.Util.getLocalizedValue("Ago");
224        if(numyears > 0)
225            return numyears + yearText + agoText;
226        else if(numdays > 1)
227            return numdays + daysText + agoText;
228        else if(numdays == 1)
229        {
230            if(numhours > 0)
231                return numdays + daysText + numhours + hourText + agoText;
232            else
233                return numdays + daysText + agoText;
234        }
235        else if(numhours > 0)
236        {
237            if(numminutes > 0)
238                return numhours + hourText + numminutes + minText + agoText;
239            else
240                return numhours + hourText + agoText;
241        }
242        else if(numminutes > 0)
243        {
244            if(numminutes > 1)
245                return numminutes + minText + agoText;
246            else
247                return numminutes + oneMinText + agoText;
248        }
249        else return window.FD.FP.Util.getLocalizedValue("Just now");
250    };
251
252    var cancelPendingSign = function(e){
253        var pendingSignID = $(e).attr('pendingSignID'),
254            confirm = window.confirm(window.FD.FP.Util.getLocalizedValue("Are you sure, you want to cancel this Pending Sign Form ?")),
255            formPath = $(e).attr('formPath'),
256            errorMessage = window.FD.FP.Util.getLocalizedValue("Error occurred while cancelling the Pending Sign form");
257            unableToCancelMessage = window.FD.FP.Util.getLocalizedValue("Unable to cancel the Pending Sign form");
258        if(confirm == true){
259            $.ajax({
260                type:"POST",
261                url: urlToCancelPendingSign,
262                dataType: 'json',
263                async: true,
264                cache: false,
265                data: {
266                    pendingSignID:pendingSignID,
267                    formPath:formPath
268                },
269                complete: function (xhr, status) {
270                    if (status === 'error') {
271                        alert(errorMessage);
272                    } else {
273                        if(xhr.responseText === "UNABLE_TO_CANCEL") {
274                            alert(unableToCancelMessage);
275                        }
276                        getPendingSignForms();
277                    }
278                }
279            });
280        }
281    };
282
283    $(document).on( "click", ".__FP_cancelPendingSign", function(){
284        cancelPendingSign(this);
285    });
286
287    $(document).on( "keypress", ".__FP_cancelPendingSign", function(e){
288        var eventCode = e.keyCode || e.charCode || e.which;
289        if(eventCode == 13 || eventCode == 32){
290            cancelPendingSign(this);
291        }
292    });
293
294    $(document).ready(getPendingSignForms());
295})(document, jQuery);
296
Full Screen

PendingObjectGrid.js

Source: PendingObjectGrid.js Github

copy
1Ext.define('PVE.grid.PendingObjectGrid', {
2    extend: 'PVE.grid.ObjectGrid',
3    alias: ['widget.pvePendingObjectGrid'],
4
5    getObjectValue: function(key, defaultValue, pending) {
6	var me = this;
7	var rec = me.store.getById(key);
8	if (rec) {
9	    var value = (pending && Ext.isDefined(rec.data.pending) && (rec.data.pending !== '')) ? 
10		rec.data.pending : rec.data.value;
11
12            if (Ext.isDefined(value) && (value !== '')) {
13		return value;
14            } else {
15		return defaultValue;
16            }
17	}
18	return defaultValue;
19    },
20
21    hasPendingChanges: function(key) {
22	var me = this;
23	var rows = me.rows;
24	var rowdef = (rows && rows[key]) ?  rows[key] : {};
25	var keys = rowdef.multiKey ||  [ key ];
26	var pending = false;
27
28	Ext.Array.each(keys, function(k) {
29	    var rec = me.store.getById(k);
30	    if (rec && rec.data && Ext.isDefined(rec.data.pending) && (rec.data.pending !== '')) {
31		pending = true;
32	    }
33	});
34
35	return pending;
36    },
37
38    renderValue: function(value, metaData, record, rowIndex, colIndex, store) {
39	var me = this;
40	var rows = me.rows;
41	var key = record.data.key;
42	var rowdef = (rows && rows[key]) ?  rows[key] : {};
43	var renderer = rowdef.renderer;
44	var current = '';
45	var pendingdelete = '';
46	var pending = '';
47
48	if (renderer) {
49	    current = renderer(value, metaData, record, rowIndex, colIndex, store, false);
50	    if (me.hasPendingChanges(key)) {
51		pending = renderer(record.data.pending, metaData, record, rowIndex, colIndex, store, true);
52	    }
53	    if (pending == current) {
54		pending = undefined;
55	    }
56	} else {
57	    current = value;
58	    pending = record.data.pending;
59	}
60
61	if (record.data['delete']) {
62	    pendingdelete = '<div style="text-decoration: line-through;">'+ current +'</div>';
63	}
64
65	if (pending || pendingdelete) {
66	    return current + '<div style="color:red">' + pending + pendingdelete + '</div>';
67	} else {
68	    return current;
69	}
70    },
71
72    initComponent : function() {
73	var me = this;
74
75	var rows = me.rows;
76
77	if (!me.rstore) {
78	    if (!me.url) {
79		throw "no url specified";
80	    }
81
82	    me.rstore = Ext.create('PVE.data.ObjectStore', {
83		model: 'KeyValuePendingDelete',
84		readArray: true,
85		url: me.url,
86		interval: me.interval,
87		extraParams: me.extraParams,
88		rows: me.rows
89	    });
90	}
91
92	me.callParent();
93   }
94});
95
Full Screen

pendingPurchaseSlices.js

Source: pendingPurchaseSlices.js Github

copy
1import { createSlice } from "@reduxjs/toolkit";
2import { addPurchaseOrder } from "./purchaseOrderSlices";
3import { updatePurchaseOrdersAction } from "./purchaseOrderSlices";
4import { createPendingPurchaseOrderAction, removePendingPurchaseOrder } from "./pendingPurchaseOrderSlices";
5export const pendingPurchaseSlice = createSlice({
6    name:"pendingPurchase",
7    initialState:{
8        pendingPurchase:[
9        ]
10    },
11    reducers:{
12        createPendingPurchase:(state,action)=>{
13            let id = state.pendingPurchase.length + 1
14            const newPurchase = {...action.payload,id:id}
15                state.pendingPurchase = [newPurchase,...state.pendingPurchase]
16        },
17        removePendingPurchase:(state,action,getState)=>{
18            console.log(getState)
19            const copy = [...state.pendingPurchase]
20            let index = state.pendingPurchase.findIndex(purchase=>purchase.saleRef == action.payload)
21            copy.splice(index,1)
22            state.pendingPurchase = copy
23        },
24        checkPendingPurchase:(state,action)=>{
25            return "popo"
26        }
27       
28      
29    }
30})
31
32export const {
33     createPendingPurchase,
34     setInventoryStock,
35     removePendingPurchase,
36     checkPendingPurchase
37    // editPurchase
38} = pendingPurchaseSlice.actions;
39
40export default pendingPurchaseSlice.reducer
41
42Array.prototype.multiIndexOf = function (el) { 
43    var idxs = [];
44    for (var i = this.length - 1; i >= 0; i--) {
45        if (this[i].saleRef === el) {
46            idxs.unshift(i);
47        }
48    }
49    return idxs;
50};
51
52
53export const createPendingPurchaseAction=(data)=>{
54    return async(dispatch)=>{
55        try{
56            const pendingPurchaseOrder = {
57                products: data.products,
58                saleRef: data.saleRef
59            }
60            dispatch(createPendingPurchase(data))
61            dispatch(createPendingPurchaseOrderAction(pendingPurchaseOrder))
62        }
63        catch(err){
64
65        }
66    }
67}
68
69export const checkPendingPurchaseAction=(data)=>{
70    return async(dispatch)=>{
71        try{
72            // console.log("checked")
73            const status =dispatch(checkPendingPurchase)
74            console.log(status)
75        }
76        catch(err){
77
78        }
79    }
80}
81
82export const removePendingPurchaseAction=(data)=>{
83    return async(dispatch,getState)=>{
84        try{
85            const {pendingPurchaseOrder} = getState();
86            var idxs = [];
87            for (var i = pendingPurchaseOrder.pendingPurchaseOrders.length - 1; i >= 0; i--) {
88                if (pendingPurchaseOrder.pendingPurchaseOrders[i].saleRef == data) {
89                    console.log(pendingPurchaseOrder.pendingPurchaseOrders[i])
90                }
91            }
92            console.log(idxs)
93            dispatch(removePendingPurchase(data))
94            dispatch(removePendingPurchaseOrder(data))
95        }catch(err){
96            console.log(err)
97
98        }
99    }
100}
Full Screen

Accelerate Your Automation Test Cycles With LambdaTest

Leverage LambdaTest’s cloud-based platform to execute your automation tests in parallel and trim down your test execution time significantly. Your first 100 automation testing minutes are on us.

Try LambdaTest

Run JavaScript Tests on LambdaTest Cloud Grid

Execute automation tests with Mocha on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.

Test now for Free
LambdaTestX

We use cookies to give you the best experience. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. Learn More in our Cookies policy, Privacy & Terms of service

Allow Cookie
Sarah

I hope you find the best code examples for your project.

If you want to accelerate automated browser testing, try LambdaTest. Your first 100 automation testing minutes are FREE.

Sarah Elson (Product & Growth Lead)