From a065e04d529da1d847b5062a12c46d916408bf32 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 21:46:22 -0500 Subject: update based on https://github.com/mdn/yari/issues/2028 --- .../adding_a_button_to_the_toolbar/index.html | 64 -------- files/bn/mozilla/add-ons/sdk/tutorials/index.html | 175 --------------------- .../add-ons/sdk/tutorials/installation/index.html | 78 --------- .../add-ons/sdk/tutorials/logging/index.html | 38 ----- .../add-ons/sdk/tutorials/unit_testing/index.html | 114 -------------- 5 files changed, 469 deletions(-) delete mode 100644 files/bn/mozilla/add-ons/sdk/tutorials/adding_a_button_to_the_toolbar/index.html delete mode 100644 files/bn/mozilla/add-ons/sdk/tutorials/index.html delete mode 100644 files/bn/mozilla/add-ons/sdk/tutorials/installation/index.html delete mode 100644 files/bn/mozilla/add-ons/sdk/tutorials/logging/index.html delete mode 100644 files/bn/mozilla/add-ons/sdk/tutorials/unit_testing/index.html (limited to 'files/bn/mozilla/add-ons/sdk/tutorials') diff --git a/files/bn/mozilla/add-ons/sdk/tutorials/adding_a_button_to_the_toolbar/index.html b/files/bn/mozilla/add-ons/sdk/tutorials/adding_a_button_to_the_toolbar/index.html deleted file mode 100644 index 0a33490189..0000000000 --- a/files/bn/mozilla/add-ons/sdk/tutorials/adding_a_button_to_the_toolbar/index.html +++ /dev/null @@ -1,64 +0,0 @@ ---- -title: Adding a Button to the Toolbar -slug: Mozilla/Add-ons/SDK/Tutorials/Adding_a_Button_to_the_Toolbar -translation_of: Archive/Add-ons/Add-on_SDK/Tutorials/Adding_a_Button_to_the_Toolbar ---- -
-

এই  টিউটরিআল বুঝতে হলে আপনাকে প্রথমে এস ডি কে ইন্সটল করতে হবে এবং সি এফ এক্স এর প্রাথমিক  জিনিস গুলা শিখতে হবে ।

-

এই টিউটোরিয়াল  এক্সশন বাটন  এ পি আই ব্যাবহার করে, যে শুধু মাত্র ফায়ার ফক্স ২৯ বা এর পরের ভারশন গুলোতে কাজ করে ।

-

 

-
-

কোন বাটন টুলবারের সাথে  সংযুক্ত করতে হলে  এক্সন বাটন বা টগল বাটন মডিউলগুলো ব্যাবহার করুন ।

-

একটি নতুন ডিরেক্টরি তৈরি করুন, তার ভেতরে ডুকুন এবং সিএফএক্স ইনিট চালান ।

-

তার পর নিচের আইকন তিনটি "ডাটা" ডিরেক্টরিতে সেভ করুন ।

- - - - - - - - - - - - - - - -
icon-16.png
icon-32.png
icon-64.png
-

Then open the file called "main.js" in the "lib" directory and add the following code to it:

-
var buttons = require('sdk/ui/button/action');
-var tabs = require("sdk/tabs");
-
-var button = buttons.ActionButton({
-  id: "mozilla-link",
-  label: "Visit Mozilla",
-  icon: {
-    "16": "./icon-16.png",
-    "32": "./icon-32.png",
-    "64": "./icon-64.png"
-  },
-  onClick: handleClick
-});
-
-function handleClick(state) {
-  tabs.open("https://www.mozilla.org/");
-}
-

Now run the add-on with cfx run. The button is added to the toolbar at the top of the browser window:

-

You can't set the initial location for the button, but the user can move it using the browser's customization feature. The id attribute is mandatory, and is used to remember the position of the button, so you should not change it in subsequent versions of the add-on.

-

Clicking the button loads https://www.mozilla.org/ into a new tab.

-

Specifying the icon

-

The icon property may specify a single icon or a collection of icons in different sizes, as in the example above. If you specify a collection of icons in different sizes the browser will automatically choose the best fit for the screen resolution and the place in the browser UI that hosts the button. Read more about specifying multiple icons.

-

The icon file must be packaged with your add-on: it may not refer to a remote file.

-

You can change the icon at any time by setting the button's icon property. You can change the icon, and the other state attributes, either globally, for a specific window, or for a specific tab. Read more about updating state.

-

Attaching a panel

-

If you need to attach a panel to a button, use the toggle button API. This is just like the action button API except it adds a boolean checked property which is toggled whenever the button is checked. To attach the panel, pass the button to the panel's show() method. For more details on this, see the toggle button's documentation.

-

Displaying richer content

-

To create more complex user interface content than is possible with just a button, use the toolbar API. With the toolbar API you get a complete horizontal strip of user interface real estate. You can add buttons to the toolbar and also frames, that can host HTML, CSS, and JavaScript.

-

Learning more

- diff --git a/files/bn/mozilla/add-ons/sdk/tutorials/index.html b/files/bn/mozilla/add-ons/sdk/tutorials/index.html deleted file mode 100644 index 25c953da9e..0000000000 --- a/files/bn/mozilla/add-ons/sdk/tutorials/index.html +++ /dev/null @@ -1,175 +0,0 @@ ---- -title: Tutorials -slug: Mozilla/Add-ons/SDK/Tutorials -tags: - - টিউটোরিয়াল -translation_of: Archive/Add-ons/Add-on_SDK/Tutorials ---- -

এই পেজ এর তালিকাগুলো নিজ হাতে গড়া অনুচ্ছেদ, কেমনে SDK ব্যবহার করে নির্দিষ্ট কাজসমূহ অর্জন করা যায় এ সম্পর্কে।

-
-

শুরু করা

-
-
-
-
-  স্থাপন করা 
-
- ডাউনলোড, স্থাপন,এবং SDK চালু করা Windows, OS X এবং Linux এ।
-
-
-
- সমস্যাসমাধান
-
- কিছু pointers ব্যবহার করা হয় গতানুগতিক সমস্যাসমূহ সমাধান করার জন্য এবং আরও সাহায্য পাওয়ার জন্য।
-
-
-
-
-
- শুরু করা
-
- SDK এর সাথে একটি simple add-ones তৈরি করুন।
-
-
-
-
-

ইউজার ইন্টারফেস তৈরি

-
- -
-
-
- পপআপ প্রদর্শন
-
- পপআাপ dialog প্রদর্শন করা HTML এবং Javascript এর সাথে।
-
- একটি context menu item যুক্ত করা
-
-        Firefox's context menu এ items যুক্ত করুন।
-
-
-
-
-

ব্রাউজার দিয়ে যোগাযোগ

-
-
-

  একটি web page খোলা   

-

         একটি web page খুলুন একটি নতুন browser tab e অথবা window তে tabs module ব্যবহার করে,এবং ইহার বিষয়বস্তুকে প্রবেশাধিকার দেয়া।

-
-
-  
-
-  
-
- পৃষ্ঠা লোড শুনুন
-
- Tabs module ব্যবহার করা অবহিত করার জন্য যখন নতুন web page load হবে, এবং তাদের বিষয়বস্তুকে প্রবেশাধিকার দেয়া হবে।
-
-
-
-
-
- open tab এর তালিকা পাওয়া
-
- বর্তমানে খোলা tabs গুলোর মাধ্যমে বারবার,এবং তাদের content access tab module ব্যবহার করুন।
-
-
-
-
-

ওয়েব পেজ পরিবর্তন

-
-
-
-
- URL এর উপর ভিত্তি করে ওয়েব পেজ পরিবর্তন করা
-
- URL এর উপর ভিত্তি করে web pages এর জন্য filters তৈরি করাঃযার URL টি ফিল্টার সাথে মিলে একটি ওয়েব পাতা লোড হয়, যখনই এটি একটি নির্দিষ্ট স্ক্রিপ্ট চালায়।
-
-
-
-
-
- সচল ওয়েব পেজ চালানো
-
- বর্তমান সক্রিয় ওয়েব পেজ এর মধ্যে পরিবর্তনশীল একটি  স্ক্রিপ্ট লোড করুন।
-
-
-
-
-

উন্নয়ন কৌশল

-
-
-
-
- লগিং
-
-
- ডায়গনিস্টিক উদ্দেশ্যে কনসোল থেকে বার্তা লগ ইন
-
-
- পূর্ণব্যবহারযোগ্য মডিউল নির্মাণ
-
- আলাদা modules এ আপনার add-on গঠন করুন যাতে এটি উন্নয়ন,ত্রুটি সরানো,এবং রক্ষণাবেক্ষণ করা সহজ হয়।পূর্ণব্যবহারযোগ্য packages তৈরি করুন যেটা আপনার modules এ ধারণ করবে,সুতরাং অন্যান্য add-on developers রাও তাদের ব্যবহার করতে পারবে।
-
- ইউনিট টেস্টিং
-
- SDK's test framework ব্যবহার করে writting and running unit tests করুন।
-
- ক্রোম কর্তৃপক্ষ
-
- components object এ access পাবেন,আপনার add-on load হওয়ার জন্য সক্রিয় করুন এবং কোন xpcom object ব্যবহার করুন।
-
- event targets তৈরি করা
-
- আপনি তাদের নিজস্ব ইভেন্ট থেকে নির্গত নির্ধারণ বস্তু সক্রিয় করুন।
-
-
-
-
-
- লোড এবং লোড না করার জন্য শুনুন
-
- যখন আপনার add-on firefox এ load বা unload হবে তখন এর বিজ্ঞপ্তি জানুন এবং আর্গুমেন্ট পাস করান add-on এ command line হতে।
-
- Third-party modules ব্যবহার করা
-
- ইনস্টল করুন এবং অতিরিক্ত মডিউল ব্যবহার করুন যা SDK এর সাথে Ship করে না।
-
- স্থানীয়করণ
-
- অনুবাদ কোড লেখা।
-
- মোবাইল উন্নয়ন
-
- Firefox Mobile এর জন্য android এর উপর add-ons উন্নয়ন করুন।
-
- Add-on ডিবাগার
-
- আপনার অ্যাড অন এর জাভাস্ক্রিপ্ট ডিবাগ করুন।
-
-
-
-
-

একসঙ্গে নির্বাণ

-
-
-
-
- ভাষ্যকার add-on
-
- একটি অপেক্ষাকৃত জটিল add-on এ walkthrough করা।
-
-
-
-

 

diff --git a/files/bn/mozilla/add-ons/sdk/tutorials/installation/index.html b/files/bn/mozilla/add-ons/sdk/tutorials/installation/index.html deleted file mode 100644 index 496e6df0c2..0000000000 --- a/files/bn/mozilla/add-ons/sdk/tutorials/installation/index.html +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: Installation -slug: Mozilla/Add-ons/SDK/Tutorials/Installation -tags: - - ইন্সটলেশন - - স্থাপন করা -translation_of: Mozilla/Add-ons/SDK/Tools/jpm#Installation ---- -

পূর্বশর্ত

-

Add-on SDK-র মাধ্যমে উন্নয়ন করতে চাইলে আপনের লাগবেঃ

- -

Git Sources থেকে Extention Building করা AMO এর জন্য

-

শুধুমাত্র addon-sdk sources এর সর্বশেষ git release tag ব্যবহার করা যেতে পারে যদি AMO তে উপস্থাপন করা হয়।

-

The git archive command প্রয়োজন হয়  git clone working directory এর কিছু git attribute placeholders বিশ্লেষণ করার জন্য।

-
1 git checkout 1.16
-2
-3 git archive 1.16 python-lib/cuddlefish/_version.py | tar -xvf -
-
-

FreeBSD/ OS X / Linux এ স্থাপন করা

-

যে স্থানটি আপনি নির্বাচন করেছেন সে স্থানের File Contents Extract করুন, এবং  shell/command prompt এর মাধ্যমে SDK এর root directory navigate করুন। উদাহরণস্বরূপঃ

-
1 tar -xf addon-sdk.tar.gz
-2 cd addon-sdk
-
-

যদি আপনি Bash user হন তবে চালু করুন (অধিকাংশ মানুষ)

-
source bin/activate
-
-

এবং আপনি যদি non-Bash user হন ,আপনার চালু করা উচিতঃ

-
bash bin/activate
-
-

আপনার কমান্ড প্রম্পট এখন SDK এর মূল ডিরেক্টরির নাম ধারণকারী একটি নতুন উপসর্গ থাকতে হবে

-
(addon-sdk)~/mozilla/addon-sdk >
-
-

Homebrew ব্যবহার করে Mac Install করা

-

যদি আপনি Mac user হন তবে SDK install করতে আপনি Homebrew ব্যবহার করতে পারেন, নিম্নোক্ত নির্দেশ ব্যবহার করেঃ

-
brew install mozilla-addon-sdk
-

একবার সফলতার সাথে এটি সম্পূর্ণ হলে, আপনি cfx program আপনার command line এ ব্যবহার করতে পারেন যে কোন সময় । আপনার bin/activate চালু করার প্রয়োজন নেই।

-

Windows এ install করা

-

যে স্থানটি আপনি নির্বাচন করেছেন সে স্থানের File Contents Extract করুন, এবং shell/command prompt এর মাধ্যমে SDK এর root directory navigate করুন। উদাহরণস্বরূপঃ

-
7z.exe x addon-sdk.zip
-cd addon-sdk
-
-

তারপর চালু করুনঃ

-
bin\activate
-
-

আপনার কমান্ড প্রম্পট এখন SDK এর এর রুট ডিরেক্টরি সম্পূর্ণ পাথ ধারণকারী একটি নতুন উপসর্গ থাকতে হবে :

-
(C:\Users\mozilla\sdk\addon-sdk) C:\Users\Work\sdk\addon-sdk>
-
-

 সক্রিয় করা

-

সক্রিয় কমান্ড কিছু environment variables set করে যেটা SDK এর জন্য প্রয়োজন। এটি শুধুমাত্র variables set করে current command prompt এর জন্য। যদি আপনি নতুন command prompt চালু করেন,SDK নতুন prompt এ সক্রিয় হতে পারবে না যতক্ষণ না পর্যন্ত আপনি activate type না করেন।

-

এটা মানে হল আপনার SDK এর অনেক কপি আপনার disk এর বিভিন্ন স্থানে থাকতে পারে এবং তাদের মধ্যে switch থাকতে পারে, অথবা এমনকি তাদের উভয়ে একই সময়ে বিভিন্ন কমান্ড লিখতে সক্রিয় থাকে।

-

সক্রিয়করণ স্থায়ী করা

-

এই variables গুলো আপনার পরিমণ্ডলে set করলে আপনার সকল  নতুন prompt তাদের নির্ণয় করে ফেলবে, আপনি সক্রিয়করণকে স্থায়ী করতে পারবেন। তারপর আপনি একটি নতুন কমান্ড প্রম্পট খুলুন প্রত্যেক সময় সক্রিয় টাইপ করার প্রয়োজন হবে না

-

কারন নতুন মুক্তিপ্রাপ্ত SDK এর সাথে সঠিক variables set পরিবর্তন হতে পারে,activation scripts পড়া উচিত কোন variables set করা প্রয়োজন তা ঠিক করার জন্য।  সক্রিয়করণ ব্যবহার করে বিভিন্ন Scripts এবং sets করে বিভিন্ন variables bash environment এর জন্য (Linux and OS X) এবং Windows environments এর জন্য।

-

Windows

-

Windows এ, bin\activate uses activate.bat, এবং আপনি command line ব্যবহার করে  setx tool or the Control Panel সক্রিয়করণ স্থায়ী করতে পাড়েন।

-

Linux / OS X

-

Linux and OS X এ, source bin/activate  activate bash script ব্যবহার করে, এবং আপনি সক্রিয়করণ স্থায়ী করতে পারবেন ~/.bashrc (on Linux) or ~/.bashprofile (on OS X) ব্যবহার করে।

-

এটির পরিবর্তে আপনার directory তে আপনি cfx program এ সাংকেতিক চিহ্ন তৈরি করতে পারেনঃ

-

 

-
ln -s PATH_TO_SDK/bin/cfx ~/bin/cfx
-
-

SDK install করার করার জন্য যদি আপনি Homebrew ব্যবহার করেন,environment variables আপনার জন্য স্থায়ীভাবে স্থাপন হয়ে থাকবে।

-

বৈধতা পরীক্ষা

-

আপনার shell prompt এর মাধ্যমে চালু করেনঃ

-
cfx
-
-

এটির নির্গমন এমন হতে হবে যে এটির প্রথম লাইন দেখতে এটির মত,অনেক লাইন তথ্য অনুসরণ করেঃ

-
Usage: cfx [options] [command]
-
-

এটি হয় cfx command-line program। এটি আপনার Add-on SDK এর প্রাথমিক interface। Firefox চালাতে আপনি এটি ব্যবহার করেন এবং আপনার add-on পরীক্ষা করেন, আপনার add-on package করুন বিতরণ করার জন্য, দলিল পরিদর্শন করুন এবং unit tests চালু করুন

-

সমস্যাসমূহ ?

-

Troubleshooting page এ চেষ্টা করুন।

-

পরবর্তী পদক্ষেপ

-

পরবর্তীতে Getting Started With cfx tutorial দেখুন,সেখানে ব্যাখ্যা করা আছে যে কেমন করে cfx tool ব্যবহার করে add-ons তৈরি করা যায়।

diff --git a/files/bn/mozilla/add-ons/sdk/tutorials/logging/index.html b/files/bn/mozilla/add-ons/sdk/tutorials/logging/index.html deleted file mode 100644 index 3e67bdd732..0000000000 --- a/files/bn/mozilla/add-ons/sdk/tutorials/logging/index.html +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: লগিং -slug: Mozilla/Add-ons/SDK/Tutorials/Logging -translation_of: Archive/Add-ons/Add-on_SDK/Tutorials/Logging ---- -
- To follow this tutorial you'll need to have installed the SDK and learned the basics of cfx.
-

 ডম কনসোল অবজেক্ট  জাভাস্ক্রিপ্ট ডিবাগ করার জন্য ব্যবহৃত হয়। কারণ ডম অবজেক্ট গুলো মেইন অ্যাড-অন কোডে পাওয়া যায় না । SDK এর নিজেস্ব গ্লোবাল কনসোল অবজেক্ট আছে যার অধিকাংশ মেথড ডম কনসোল এর মত , যার মধ্যে আছে লগ এরর, ওয়ার্নিং অথবা ইনফরমেশনাল ম্যাসেজ। কনসোল এ এক্সেস করার জন্য আপনার কোন কিছুর প্রয়োজন()নেই। এটি automatically আপনার জন্য দেয়া আছে ।

-

The console.log() method prints an informational message:

-
console.log("Hello World");
-
-

Try it out:

- -

Firefox will start, and the following line will appear in the command window you used to execute cfx run:

-
info: Hello World!
-
-

console in Content Scripts

-

You can use the console in content scripts as well as in your main add-on code. The following add-on logs the HTML content of every tab the user loads, by calling console.log() inside a content script:

-
require("sdk/tabs").on("ready", function(tab) {
-  tab.attach({
-    contentScript: "console.log(document.body.innerHTML);"
-  });
-});
-
-

console Output

-

If you are running your add-on from the command line (for example, executing cfx run or cfx test) then the console's messages appear in the command shell you used.

-

If you've installed the add-on in Firefox then the messages appear in Firefox's Browser Console.

-

But note that by default, calls to console.log() will not result in any output in the Error Console for any installed add-ons: this includes add-ons installed using the Add-on Builder or using tools like the Extension Auto-installer.

-

See "Logging Levels" in the console reference documentation for more information on this.

-

Disabling strict mode

-

By default, cfx enables JavaScript strict mode, which will cause a lot of JavaScript warnings to be logged to the console. If this makes it harder to interpret logging output, you can disable strict mode by opening the file at python-lib/cuddlefish/prefs.py  and setting "javascript.options.strict" to False.

-

Learning More

-

For the complete console API, see its API reference.

diff --git a/files/bn/mozilla/add-ons/sdk/tutorials/unit_testing/index.html b/files/bn/mozilla/add-ons/sdk/tutorials/unit_testing/index.html deleted file mode 100644 index 1f7ad87c4d..0000000000 --- a/files/bn/mozilla/add-ons/sdk/tutorials/unit_testing/index.html +++ /dev/null @@ -1,114 +0,0 @@ ---- -title: ইউনিট টেস্টিং -slug: Mozilla/Add-ons/SDK/Tutorials/Unit_testing -translation_of: Archive/Add-ons/Add-on_SDK/Tutorials/Unit_testing ---- -
-

এই tutorial আপনার থাকতে দরকার হবে অনুসরন করতে installed the SDKজ্ঞানী basics of cfxআর অনুসরন করা tutorial writing reusable modules.

-
-
-

যদি আপনি ব্যবহার করতেন jpm cfx বদলে, cfx থেকে স্থানান্তর করতে গাইড দেখে, in particular সেকশান loading modules from test code.

-
-

sdk দেয় একটি কাঠামো সাহায্য করতে বানায় আর আপনার কোড-এর জন্য অংশ পরীক্ষা দৌড়ায়এটা হাতেকলমে দেখাতে কাজ করে আমরা একটি সাদাসিধে-এর জন্য কিছু অংশ পরীক্ষা লিখব Base64 মডিউল সঙ্কেতাক্ষরে লিখতে.

-

একটি  সাদাসিধে  base64  মডিউল

-

একটি ওয়েব পাতায়, আপনি base64 সম্পাদন করতে পারেন ( -rrb- আর atob -lrb- ) কাজ ব্যব‌হার সঙ্কেতাক্ষরে লিখতে আর btoa ব্যবহার করা সন্কেত উদঘাটন করতে।দুর্ভাগ্যক্রমে এই কাজ ব্যব‌হার জানালা জিনিষে সংযুক্ত করা হয়: যেহেতু এই জিনিষ না উপস্থিত আপনার প্রধান add-on কোডে, atob ( -rrb- আর btoa -lrb- ) নেই উপস্থিত either। তাই আমরা একটি base64 মডিউল বানাবো প্ল্যাটফর্ম থেকে এই কাজ ব্যব‌হার অনাবৃত করতে।

-

শুরুতে, একটি নতুন ডিরেক্টরি বানাতে, এটায় পথ খোঁজতে, আর cfx init দৌড়াতে। Now create a new file in "lib" called "base64.js", and give it the following contents:এখন `` libে '' `` "base64.js" ডাকা একটি নতুন ফাইল বানান।

-
const { atob, btoa } = require("chrome").Cu.import("resource://gre/modules/Services.jsm", {});
-
-exports.atob = a => atob(a);
-exports.btoa = b => btoa(b); 
-

এই কোড দুটো কাজ ব্যব‌হার, যা মাত্র প্ল্যাটফর্ম-এর btoa ডাকে রপ্তানি করে() and atob() functions. ব্যবহারে মডিউল দেখাতে, সম্পাদন করতে "main.js"দাখিল করুন যেহেতু  এটি অনুসরন করে:

-
var base64 = require("./base64");
-
-var button = require("sdk/ui/button/action").ActionButton({
-  id: "base64",
-  label: "base64",
-  icon: "./icon-16.png",
-  onClick: function() {
-    encoded = base64.btoa("hello");
-    console.log(encoded);
-    decoded = base64.atob(encoded);
-    console.log(decoded);
-  }
-});
-

আপনার add-ons `` ডাটা '' ডিরেক্টরিতে বাঁচাতে  উপরন্তু দৃষ্টান্ত  একটি প্রতিমা উল্লেখ করে `` icon-16 দাখিল করে থাকতে হবে। । আপনি এই প্রতিমা ডাউনলোড করতে পারতেন: .

-

এখন "main.js" আমদানি base64 মডিউল আর ডাক এটার দুটো exported কাজ ব্যব‌হার।

- - - - - - -
যদি আমরা add-on দৌড়াতাম আর বাটন ক্লিক করি, আমরা অনুসরন করা লগ করা আউটপুট দেখা উচিত
-

:

-
info: aGVsbG8=
-info: hello
-
-

পরীক্ষা করে  base64  মডিউল

-

navigate এ্যাডঅন-এর-এর test directory আর delete test-main.js ফাইলএটার জায়গায় বানান একটি ফাইল যা ডাকা হলো test-base64.js অনুসরন করা অভ্যন্তরস্থ বস্তু-এর সাথে:

-
var base64 = require("./base64");
-
-exports["test atob"] = function(assert) {
-      assert.ok(base64.atob("aGVsbG8=") == "hello", "atob works");
-}
-
-exports["test btoa"] = function(assert) {
-  assert.ok(base64.btoa("hello") == "aGVsbG8=", "btoa works");
-}
-
-exports["test empty string"] = function(assert) {
-  assert.throws(function() {
-                  base64.atob();
-                },
-                "empty string check works");
-}
-
-require("sdk/test").run(exports); 
-

এটা দাখিল করেরপ্তানি করে তিন কাজ ব্যব‌হার, যার each একটি একাকী যুক্তি পেতে আশা করে যা হচ্ছে একটি assert জিনিষ. assert যোগান দেয়া হয় test/assert module আর বাস্তবায়িত করেCommonJS Unit Testing specification.

- -

এই মুহূর্তে আপনার add-on ought এই মত দেখতে:

-
  /base64
-      package.json
-      README.md
-      /doc
-          main.md
-      /lib
-          main.js
-          base64.js
-      /test
-          test-base64.js
-
-

এখন cfx নির্বাহ করুন-- এ্যাডঅন-এর মূল ডিরেক্টরি থেকে verbose পরীক্ষা করুন। আপনি এখন এর মত কিছু দেখা পাবেন:

-
Running tests on Firefox 13.0/Gecko 13.0 ({ec8030f7-c20a-464f-9b0e-13a3a9e97384}) under darwin/x86.
-info: executing 'test-base64.test atob'
-info: pass: atob works
-info: executing 'test-base64.test btoa'
-info: pass: btoa works
-info: executing 'test-base64.test empty string'
-info: pass: empty string check works
-
-3 of 3 tests passed.
-Total time: 5.172589 seconds
-Program terminated successfully.
-
- - - - - - -
কি ঘটে এখানে হচ্ছে সে cfx পরীক্ষা
-

যোজক চিহ্ন নোট করুন "test" module নামে। cfx testwill অন্তর্ভুক্ত করে একটি মডিউল যা ডাকা হলো "test-myCode.js", কিন্তু, অভিলাষ মডিউল ছাঁটাই করে যা ডাকা হলো "test_myCode.js" or "testMyCode.js".

- -

স্পষ্টত, আপনার-- verbose অপশন পাশ করতে cfx যদি আপনি চাইতেন না হবে না; এত মাত্র করতে আউটপুট আরো সহজ পড়তে বানায়।

-- cgit v1.2.3-54-g00ecf