Академический Документы
Профессиональный Документы
Культура Документы
Juntao Qiu
Test-Driven Development with React and TypeScript: Building
Maintainable React Applications
Juntao Qiu
Wantirna, 3152, VIC, Australia
v
Table of Contents
vi
Table of Contents
vii
Table of Contents
viii
Table of Contents
Unit Tests����������������������������������������������������������������������������������������������������������132
Refactoring��������������������������������������������������������������������������������������������������133
Book Detail Page�����������������������������������������������������������������������������������������137
File Structure�����������������������������������������������������������������������������������������������139
Testing Data������������������������������������������������������������������������������������������������������141
User Interface Refinement��������������������������������������������������������������������������������143
Using Grid System���������������������������������������������������������������������������������������144
Handling Default Value��������������������������������������������������������������������������������������146
A Failing Test with undefined����������������������������������������������������������������������146
One Last Change?���������������������������������������������������������������������������������������������149
Summary����������������������������������������������������������������������������������������������������������150
ix
Table of Contents
x
Table of Contents
Index�������������������������������������������������������������������������������������������������259
xi
About the Author
Juntao Qiu is an accomplished software
developer renowned for his expertise
in producing high-quality and easily
maintainable code. He is committed to
helping individuals improve their code-
writing abilities and generously shares his vast
knowledge and experience through multiple
platforms, including books such as this one
and Maintainable React (Leanpub, 2022).
In addition, Juntao hosts a YouTube channel (@icodeit.juntao) where
he provides valuable insights, tips, and best practices for writing clean
code and performing refactoring. Juntao’s goal is to empower developers,
enabling them to reach their full potential and have a positive impact on
the software development industry.
xiii
About the Technical Reviewers
Jeff Friesen is a freelance teacher and
software developer with an emphasis on
Java. In addition to authoring Java I/O, NIO
and NIO.2 (Apress) and Java Threads and
the Concurrency Utilities (Apress), Jeff has
written numerous articles on Java and other
technologies (such as Android) for JavaWorld
(JavaWorld.com) – now InfoWorld (www.
infoworld.com/category/java/), informIT
(InformIT.com), Java.net (no longer in existence), SitePoint (SitePoint.
com), and other websites. Jeff can be contacted via his email address:
jefff@xplornet.ca.
xv
Acknowledgments
I am profoundly grateful to my ThoughtWorks colleagues for their
enthusiastic engagement and invaluable contributions during the
development of this book. Our project discussions were a fountain of
insight, enriching the narrative with an array of diverse perspectives. A
special acknowledgment goes to Evan Bottcher for his meticulous review
and for providing an eloquent foreword for the book.
Before embarking on the second edition, I reached out to my
newsletter (https://juntao.substack.com/) subscribers with a survey,
seeking their expectations for the new iteration. The response was
overwhelming and deeply informative – my heartfelt thanks go out to
those dedicated readers who took the time to provide their input.
I must extend my profound appreciation to the editorial team for their
indispensable support throughout the second edition’s journey. Their
expert advice has proven invaluable in refining the text, and it’s their
tireless dedication that has brought this project to fruition.
Finally, upon first sharing my book’s vision with my colleagues
at ThoughtWorks, the outpouring of valuable feedback I received –
spanning from minor typographical corrections to substantial technical
suggestions – was truly overwhelming. In particular, on a cool morning
in May 2020, I was greeted with an uplifting email from Hannah Bourke,
who not only expressed her appreciation for the book but also offered
her editing assistance as a native English speaker and fellow developer.
Her subsequent pull requests offered not just high-quality language
corrections but also insightful technical review comments from a learner’s
perspective.
xvii
Acknowledgments
xviii
Foreword 1
Sometimes, I find it hard to believe that it’s been more than two decades
since Kent Beck published Extreme Programming Explained including
Test-Driven Development (TDD) as a core practice. In the years since then,
the use of automated testing has become quite commonplace, something
that almost all developers are familiar with – however, the “Red-Green-
Refactor” cycle of TDD is often missing. The reality is that building
software test first is not easy or trivial in real-world software development
and requires deliberate practice and usually someone experienced to
learn from.
At ThoughtWorks, my role is Head of Engineering – responsible for the
quality of the software that our teams produce for and with our clients.
We set a high standard for the “internal” quality of the code we produce,
wanting it to be maintainable and extensible so that it can quickly be
changed with confidence. Test-Driven Development is a default practice
in ThoughtWorks – our experience shows that the practice leads to better
software design and good confidence from a comprehensive automated
test suite.
In my years at ThoughtWorks, I’ve seen the phenomenal rise in the
importance of JavaScript and browser applications. In 2010, we advised
that the industry should treat JavaScript as a first-class language (www.
thoughtworks.com/radar/languages-and-frameworks/javascript-
as-a-first-class-language) on the ThoughtWorks Technology Radar,
applying all of the same engineering rigor as other platforms. As one of
the authors of the Technology Radar, I’ve seen and helped document the
explosion of tooling and frameworks in JavaScript, many of which have
been related to the area of test automation.
xix
Foreword 1
Evan Bottcher
March 2021
xx
Foreword 2
Landing in the middle of a React project that had very low test coverage,
in a team that had aspirations to improve it, but without a clear strategy
of how to go about it, I struggled to find resources that stepped out how to
approach testing for a frontend project. I couldn’t find a clear explanation
of how to implement Test-Driven Development for a UI, let alone
specifically for React. This book couldn’t have come at a better time.
There are a plethora of different testing methodologies and libraries
available just for React. The ones you choose will depend on many
things. This book doesn’t prescribe a particular solution but establishes
the purpose of tests in driving out specifications and suggests an overall
approach, with practical guidance and examples. Juntao provides a
holistic explanation of the purpose and implementation of Test-Driven
Development for React, demonstrating the benefits of moving testing
earlier in the process, improving the robustness and design of our code.
Juntao’s years of experience, his eagerness and passion for learning
and sharing his knowledge in a didactic way, help to make this a relevant,
practical, and engaging guide to follow and have given me confidence in
my own testing strategies.
Hannah Bourke
March 2021
xxi
Introduction
This comprehensive book is your ultimate guide to mastering Test-Driven
Development (TDD) in the context of React and TypeScript. Whether you're
a seasoned developer seeking to refine your skills or a newcomer eager to
embrace industry-standard practices, this book caters to all levels of expertise.
Spanning a wide range of topics, each chapter in this book is
thoughtfully designed to provide you with a deep understanding of TDD
principles and their application in real-world scenarios. Let's take a
glimpse into the chapters and their role in your learning journey:
xxiii
Introduction
By following along with each chapter, you'll not only acquire the
knowledge and skills to excel in TDD but also experience the benefits
firsthand. Faster feedback cycles, improved code quality, enhanced
collaboration, and the confidence to make changes and add new features
are just a few of the advantages you'll gain.
Are you ready to embark on a transformative journey toward
becoming a more confident, efficient, and skilled developer? Test-Driven
Development with React and TypeScript: Building Maintainable React
Applications is your comprehensive companion. Let the power of TDD
guide your development process, elevate your coding skills, and lay the
foundation for a successful career in software development. Get ready to
dive in and unlock the full potential of TDD in your React projects.
xxiv
CHAPTER 1
A Brief History
of Test-Driven
Development
My purpose in writing this chapter is not to copy and paste cliches from
blogs or to make it seem like I was part of the historic events (such as the
Agile Manifesto or Extreme Programming activities) that led to the creation
of Test-Driven Development as a methodology – believe me, I’m not that old.
However, I do believe that providing context around the topics we’ll be
discussing in this book can be helpful. In this chapter, we’ll explore the basic
workflow of TDD and the various practical approaches used by different
schools of thought. If you prefer to jump straight into the code, feel free to do
so by navigating to the next chapter and getting your hands dirty.
1
https://martinfowler.com/bliki/ExtremeProgramming.html
© Juntao Qiu 2023 1
J. Qiu, Test-Driven Development with React and TypeScript,
https://doi.org/10.1007/978-1-4842-9648-6_1
Chapter 1 A Brief History of Test-Driven Development
• Eliminate duplication
The cycle repeats with each new feature or functionality, with the goal
of producing high-quality code that meets the specified requirements
and is maintainable over time. The Red-Green-Refactor cycle (Figure 1-1)
emphasizes writing automated tests before writing any production code,
ensuring that the code is continually tested and improved as it evolves.
2
Chapter 1 A Brief History of Test-Driven Development
This book aims to address these questions and equip you with the
knowledge and skills necessary to apply these techniques with confidence
in your daily workflow. By the end of the book, you should be well
equipped to implement the discussed techniques effectively.
3
Chapter 1 A Brief History of Test-Driven Development
4
Chapter 1 A Brief History of Test-Driven Development
Types of TDD
Although TDD is a broad and diverse concept with many variations and
different schools, such as UTDD, BDD, ATDD, and others, it traditionally
implied Unit Test–Driven Development or UTDD. However, the TDD
discussed in this book is an extended version of the conventional concept,
known as Acceptance Test–Driven Development (ATDD), which places a
strong emphasis on writing acceptance tests from the business perspective
and using them to drive the development of production code.
2
SOLID is an acronym for a set of principles in object-oriented design that
promote maintainability, flexibility, and extensibility of software. Each letter
in SOLID represents a principle: Single Responsibility Principle (SRP), Open/
Closed Principle (OCP), Liskov Substitution Principle (LSP), Interface Segregation
Principle (ISP) and Dependency Inversion Principle (DIP).
5
Chapter 1 A Brief History of Test-Driven Development
Having various tests in different layers can ensure that we are always
on the right track and have the correct functionality.
When you look at this process closely, you find that during the
development stage, the acceptance test could be failing for quite some
time. The feedback loop turns out to be very long, and there is a risk that
an always-failed test means no test (protection) at all.
Developers could be confused about whether there are defects in the
implementation or whether there is any implementation at all.
To resolve this problem, you have to write acceptance tests in relatively
small chunks, testing a tiny slice of the requirement at a time. Alternatively,
you could use the “fake it until you make it” approach, as we are going to
use across this book.
The steps almost remain the same; only an extra fake step is added:
7
Chapter 1 A Brief History of Test-Driven Development
Behavior-Driven Development
Another important variation of TDD is BDD, or Behavior-Driven
Development. Behavior-Driven Development is an agile practice that
encourages collaboration among different roles, developers, quality engineers,
business analysts, or even other interested parties in a software project.
Although BDD is to some extent a general idea about how software
development should be managed by both business interests and technical
insight, the practice of BDD involves some specialized tools. For example,
a Domain-Specific Language (DSL) is used to write tests in natural
language that can be easily understood by nontechnical people and can be
interpreted by code and executed behind the scenes.
The following code snippet of a BDD test case shows how a
requirement can be described:
Prerequisites of TDD
To be candid, TDD can be a challenging methodology to apply. Several
prerequisites must be met before implementing it effectively. A crucial
prerequisite for TDD is a developer’s ability to detect code smells and
refactor them toward better design. Suppose, for example, you encounter
smelly code, such as a lack of abstractions or magic numbers, and are
unsure how to improve it. In that case, TDD alone may not be sufficient.
While the TDD workflow must be followed, there is a risk of creating
unmaintainable tests in addition to producing low-quality code.
8
Chapter 1 A Brief History of Test-Driven Development
There are a lot of tutorials and articles out there to describe techniques
you should use to do TDD, and some may even involve describing how to
split tasks before implementing TDD. However, things discussed in those
tutorials are often oversimplified and can be hard to apply to a real-world
project directly.
For example, in a web application, both the interaction and a
considerable portion of business logic now exist in the frontend: the
UI. The traditional techniques of how to write a unit test to drive backend
logic are already outdated.
Tasking
Another critical skill required by TDD is splitting a large requirement into
smaller chunks through tasking. I would suggest every developer should
learn how to split requirements before they even start to write their first test.
We’ll discuss the tasking process in detail in the next chapter.
10
Chapter 1 A Brief History of Test-Driven Development
11
Chapter 1 A Brief History of Test-Driven Development
Summary
Refactoring depends on the sense and experience of identifying code
smells. Once you find a code smell, you can then apply the corresponding
refactoring technique. And then we may achieve maintainable, human-
readable, extendable, and clean code along the way.
In the next chapter, we will introduce a concrete example to
demonstrate how to apply TDD step by step. Along with that example,
we will also cover the fundamental skills needed for implementing TDD,
including how to use the jest testing framework and how to do tasking with
real-world examples.
Further Reading
There is extensive debate around TDD – every now and then, you would
see people arguing about whether we need TDD or not or the right way
to implement TDD. I found the following articles are really helpful in
understanding some of those arguments:
3
https://blog.cleancoder.com/uncle-bob/2016/11/10/TDD-Doesnt-work.html
4
https://martinfowler.com/articles/is-tdd-dead/
12
Chapter 1 A Brief History of Test-Driven Development
5
www.goodreads.com/book/show/3735293-clean-code
6
https://martinfowler.com/books/refactoring.html
13
CHAPTER 2
1
https://jestjs.io/
© Juntao Qiu 2023 15
J. Qiu, Test-Driven Development with React and TypeScript,
https://doi.org/10.1007/978-1-4842-9648-6_2
Chapter 2 Get Started with Jest
mkdir jest-101
cd jest-101
npm init -y #init the current folder with default settings
2
https://nodejs.org/en/download
16
Chapter 2 Get Started with Jest
After the installation, you can run jest --init to specify some default
settings, such as where jest should find the test files and the source code,
which environment (there are a lot) jest should run against (browser or
node for the backend), and so on. You have to answer some questions to
let jest understand your requirements; for now, let’s just accept all the
default settings by saying Yes for all the questions.
Note that if you have installed jest globally (with npm install jest -g),
you can use the following command to init the config directly:
jest --init
Otherwise, you will have to use the local installation by npx, which
looks for jest binary from node_modules/.bin/ and invokes it:
17
Chapter 2 Get Started with Jest
And then create a babel.config.js file in the root of our project (the
jest-101 folder), with the following content:
module.exports = {
presets: [['@babel/preset-env', {targets: {node: 'current'}}]],
};
module.exports = {
presets: [
['@babel/preset-env', {targets: {node: 'current'}}],
'@babel/preset-typescript',
],
};
We’re all set now. It’s time to write our first Jest test.
18
Chapter 2 Get Started with Jest
The file ends with "test.ts", that means it’s a pattern that jest will
recognize and treat them as tests, as defined in the jest.config.js we
generated previously:
describe("calculator", function () {
it("should be able to add two numbers", function () {
expect(add(1, 2)).toEqual(3);
});
});
19
Chapter 2 Get Started with Jest
export { add };
PASS src/calc.test.ts
calculator
✓ add two numbers (1 ms)
describe("calculator", () => {
it("should perform addition", () => {});
it("should perform subtraction", () => {});
it("should perform multiplication", () => {});
it("should perform division", () => {});
});
describe("calculator", () => {
describe("should perform addition", () => {
it("adds two positive numbers", () => {});
it("adds two negative numbers", () => {});
it("adds one positive and one negative numbers", () => {});
});
});
21
Chapter 2 Get Started with Jest
context. This way, the test suite is easier to understand and more closely
aligned with the needs of the stakeholders who will ultimately benefit from
the software being tested.
describe("Checkout", () => {
it("should check if any appliance is broken", () => {});
it("should refund guest when checkout is earlier than
planned", () => {});
});
});
describe("addition", () => {
it("adds two positive numbers", () => {
const options = {
precision: 2,
};
22
Chapter 2 Get Started with Jest
describe("addition", () => {
let calc = null;
beforeEach(() => {
const options = {
precision: 2,
};
calc = new Calculator(options);
});
23
Chapter 2 Get Started with Jest
describe("database", () => {
let db = null;
beforeEach(() => {
db.connect("localhost", "9999", "user", "pass");
});
afterEach(() => {
db.disconnect();
});
});
24
Chapter 2 Get Started with Jest
beforeAll(() => {
db.connect("localhost", "9999", "user", "pass");
});
afterAll(() => {
db.disconnect();
});
Basic Usages
Equality
toEqual and toBe may be the most common matchers you will find and use
in almost every test case. As the name implies, they are used to assert whether
values are equal to each other (the actual value and the expected value).
For example, it can be used for string, number, or composed objects:
25
Chapter 2 Get Started with Jest
The last test will fail. For primitives like strings, numbers, and
booleans, you can use toBe to test the equality. While for Objects,
internally jest uses Object.is to check, which is strict and compares
objects by memory address. So if you want to make sure all the fields are
matching, use toEqual.
Sometimes, you might not want an exact match. Say you want a
string to be matching some particular pattern. Then you can use toMatch
instead:
26
Another random document with
no related content on Scribd:
The ointment-bearing women as they came with myrrh unto thy
grave, O Saviour, wail’d; but an angel spake with them, and said,
Why reckon ye the living with the dead? for he is risen from the
grave as God.
Glory to the Father....
Let us adore the Father, and his Son, also the Holy Ghost, the
Holy Trinity in substance one, exclaiming with the seraphim, Thou
holy, holy, holy art, O Lord.
Both now and ever....
Thou, Virgin, who didst bear the Giver of life, hast Adam ransomed
from sin, and Eve hast given joy instead of grief; for he that was
made flesh of thee, the God and man, hath them that fell from life
restored thereunto.[4]
XIV. Glory to God in the highest, and on earth peace, goodwill to
men. We hymn thee, we bless thee, we worship thee, we glorify
thee, we give thanks to thee for thy great glory, O Lord, the heavenly
King, O God, the Father almighty, O Lord, the only-begotten Son,
Jesus Christ, and O Holy Ghost. O Lord God, O Lamb of God, O
Son of the Father, thou that takest away the sins of the world, have
mercy upon us; thou that takest away the sins of the world, accept
our prayer. Thou that sittest on the right hand of the Father, have
mercy upon us. For thou alone art holy, thou alone art Lord, O Jesus
Christ, to the glory of God the Father. Amen. Every day will I bless
thee, and I will praise thy name to ages, and to ages of ages. Lord,
thou hast been our refuge in generation and generation. I have said,
O Lord, have mercy upon me, heal my soul, for I have sinned
against thee. Lord, I have fled unto thee, teach me to do thy will, for
thou art my God; for with thee is the fountain of life, in thy light shall
we see light: O continue forth thy mercy to them that know thee.
Vouchsafe, O Lord, to keep us this day without sin. Blessed art
thou, O Lord, O God of our fathers, and praised and glorified is thy
name to ages. Amen. O Lord, may thy mercy be upon us, like as we
have put our trust in thee. Blessed art thou, O Lord, O teach me by
thy statutes. Blessed art thou, O Master, give me understanding by
thy statutes. Blessed art thou, O Holy One, enlighten me in thy
statutes. O Lord, thy mercy endureth for ever, despise not the work
of thy hand. To thee is due praise, to thee is due a song, to thee is
due glory, to the Father, and to the Son, and to the Holy Ghost, now
and ever, and to ages of ages. Amen.[5]
XV. It is a good thing to give thanks unto the Lord, and to sing unto
thy name, O Most High, to proclaim thy mercy in the morning, and
thy truth every night.
XVI. The irmi of the great canon.
1. A help and protection hath he become unto me unto salvation,
he is my God, and I will glorify him, my father’s God, and I will exalt
him; for he is glorified in glorious wise.
2. Give ear, O heaven, and I will speak, and I will sing Christ who
hath come in flesh from the Virgin.
See ye, see ye, that I am God, who of old rained manna, and
caused water to spring from the rock in the wilderness for my people,
by my sole right hand and by my strength.
3. On thy commandments’ unmov’d rock, stablish thy church, O
Christ.
Stablish my fainting heart, O Lord, on thy commandments’ rock;
for thou alone art holy and the Lord.
4. The prophet heard of thine approach, O Lord, and fear’d; for
thou didst purpose of the Virgin to be born, and to appear ’mongst
men; and he exclaim’d, I heard the report of thee, and feared: glory
to thy power, O Lord.
5. Rising from the night betimes, O lover of mankind, I pray,
Enlighten me, and lead me in thine ordinances, and teach me,
Saviour, to perform thy will.
6. I cried with my whole heart to the merciful God, and he heard
me from the lowest hades, and brought back my life from corruption.
7. We have sinned, we have transgressed, we have been
unrighteous before thee, we have neither loved nor wrought that
which thou hast commanded us; still, cast us not away at the last, O
God of our fathers.
8. Him that heaven’s hosts glorify, and at whose presence quake
the cherubim and seraphim, let every spirit and creature sing, bless,
and set up for evermore.
9. From conception seedless unspeakable’s the birth, of Mother
husbandless corruptless is the fruit; for God’s nativity hath nature
form’d anew. Then we, all generations, right-believingly thee magnify
as Mother who was divinely wed.
XVII. Thou who man-lovingly in depth of wisdom orderest all, and
unto all dost grant that which of service is, O Maker sole; rest thou
thy servants’ souls, O Lord, for they have plac’d their trust in thee,
Our Maker, and our Author, and our God.
We have thee as a fortress and a haven, and am accepted
mediatress with God, whom thou didst bear, God-bearing one
unwed, salvation thou of them that faithful be.[6]
XVIII. God is the Lord, and hath manifested himself unto us:
blessed is he that cometh in the name of the Lord.[7]
XIX. Hear us, O God our Saviour, thou hope of all the ends of the
earth, and of them that are far away upon the sea; and be merciful,
be merciful, O Master, concerning our sins, and have mercy upon us.
For a merciful and man-loving God thou art, and to thee we ascribe
glory, to the Father, and to the Son, and to the Holy Ghost, now and
ever, and to ages of ages.
XX. Blessed be the name of the Lord, from henceforth, and to all
ages.
XXI. Forgive, remit, concede, O God, our sins, voluntary and
involuntary, those in word and in deed, those in knowledge and in
ignorance, those in the day and in the night, those in thought and in
intention; concede them all to us, as being good and lover of
mankind.
XXII. And may the mercies of the great God and of our Saviour
Jesus Christ be with all of you.[8]
NOTE III.
THE EASTER CANON, ETC. TO ELUCIDATE CHAPTER XVII.
Troparion. Tone v.
Christ is risen from the dead, death by death down doth he tread,
and on them that dwell in graves he bestoweth life.
Verse. Let God arise, and let his enemies be scattered, and let
them that hate him flee from before him.
Verse. As smoke is driven away, so drive them away, as wax
melteth at the presence of fire,
Verse. So let the sinners perish at the presence of God, but let the
righteous rejoice.
Verse. This is the day which the Lord hath made, let us rejoice and
be glad therein.
Verse. Glory to the Father, and to the Son, and to the Holy Ghost.
Verse. Both now and ever, and to ages of ages. Amen.
And to every verse the troparion, Christ is risen ... is added.
The Canon in tone i. Ode i.
Irmos. It is the day of resurrection! Ye folk, be we enlightened! It is
the Pascha, the Pascha of the Lord! For out of death to life, and unto
heaven from earth Christ God hath led us forth, us, singing victory’s
song.
Refrain. Christ is risen from the dead! This is said before every
Troparion in all the Odes unless otherwise indicated.
Troparion. Let us the senses cleanse, and we shall see, in light
accessless of the resurrection shining Christ, and we shall clearly
hear him saying, Hail! we, singing victory’s song.
Troparion. Let heaven, for ’tis meet, rejoice; and let the earth be
glad; and let the world, all that unseen is and is seen, keep festival;
for Christ is risen: joy eterne!
The Irmos is repeated, and they sing, Christ is risen ... the whole.
And so after every Ode.
Ode iii.
Irmos. Come, let us drink the beverage new, not that from barren
rock in wondrous wise outpour’d; but incorruption’s fount, shower’d
from the grave of Christ, in whom we stablish’d are.
Troparion. Now fill’d is all with light, the heaven, the earth, yea,
and the underworld. Then let the whole creation festal keep for
Christ’s awake, whereby it stablish’d is.
Troparion. I was entomb’d with thee, Christ, yesterday: to-day, at
thine arising, I awake. With thee I yesterday was crucified: O
Saviour, in thy kingdom me glorify with thee.
Hypacoë. Tone iv.
Preventing the dawn, and finding the stone rolled away from the
grave, they that accompanied Mary from an angel heard, Why seek
ye as a man among the dead him that in light accessless dwells?
Behold the swathes of death! Hasten, and tell the world the Lord is
risen, who slayeth death; for he is Son of God, who saves the race of
men.
Ode iv.
Irmos. With us on watching tower divine may the inspired
Abbacum stand, and show a radiant angel speaking plain,
Salvation’s for the world to-day; for Christ, th’ almighty one, is risen.
Troparion. Christ hath appeared as a male opening the Virgin’s
womb. As mortal, he is call’d a lamb; as undefil’d by stain, our
Pasch; and, as true God, he’s perfect nam’d.
Troparion. As yearling lamb our blessed crown, even Christ, of his
own will, as cleansing Pasch, was slain for all; and from the grave
hath shin’d to us again, he, glorious Sun of righteousness.
Troparion. David, divine forefather, leap’d, dancing the typical ark
before; and, we, beholding types fulfill’d, be we divinely glad, we,
holy folk of God; for Christ, th’ almighty one, is risen.
Ode v.
Irmos. In the deep dawn let us arise, and let us bring, instead of
myrrh, the Lord a song, and we the Sun of righteousness shall see,
Christ shining life to all.
Troparion. They that were held by hades’ bonds when they thy
boundless pity saw, hasten’d, O Christ, unto the light, praising, with
joyful feet, th’ eternal Pasch.
Troparion. Bearing the lamps, precede we Christ, who, as a
bridegroom, from the grave comes forth, and, with the festal-loving
ranks, let us together keep the saving Pasch of God.
Ode vi.
Irmos. Thou didst descend into earth’s lowest parts, O Christ, and
break the eternal bonds that held the captives bound, and the third
day didst rise out of the sepulchre, as Jonas from the whale.
Troparion. Keeping the seals entire, thou didst arise, O Christ, out
of the sepulchre, who, at thy birth, didst not destroy the virgin bars;
and thou hast op’d to us the doors of paradise.
Troparion. My Saviour, who, as God, didst to the Father bring
thyself, of thine own will, an offering living and unsacrific’d also,
arising from the grave, thou hast, along with thee, raised all Adam’s
race.
Condakion. Tone viii.
If into the grave thou didst descend, Immortal One, yet didst thou
overthrow the might of hades, and, as victor, rise, Christ God, unto
the women bearing myrrh exclaiming, Hail! and giving peace to thine
apostles, O thou that grantest resurrection unto them that fallen be.
Icos.
The Sun, that was before the sun, set once within a grave, the
maidens bearing myrrh, preventing dawn, sought as the day, and
unto one another cried, Come ye, O friends, let us with scents anoint
the body that life-bringing is, and buried is, the flesh, that raiseth
fallen Adam, that lieth in a grave. Let us go on, let us make haste,
like as the Magi did; and let us bring the myrrh as gift to him that’s
wrapp’d, not in the swaddling bands, but in a winding-sheet; and let
us weep, and let us cry, Master, arise, who grantest resurrection unto
them that fallen be.
Ode vii.
Irmos. He that delivered the children from the furnace became
man, and suffered as mortal, and, by his suffering, endued the
mortal with the beauty of immortality, even he, our fathers’ God, who
only blessed and most glorious is.
Troparion. The women who were divinely wise sped back to thee
with myrrh; and him whom they sought with tears as mortal, they
worshipp’d with joy as living God; and told, O Christ, to thy disciples
the glad tidings of the mystic Pasch.
Troparion. We celebrate the death of death, the overthrow of
hades, the first-fruits of another life that endless is, and sing
exultingly the Cause, even him, our fathers’ God, who only blessed
and most glorious is.
Troparion. How truly sacred and all-festal is this saving and
brightly beaming night, which heraldeth the rising of the splendour-
bearing day, on which the ageless Light in flesh hath shin’d to all
from out the grave.
Ode viii.
Irmos. This is the chosen and holy day, the one that is of sabbaths
king and lord. It feast of feasts is, and triumph is of triumphs, on
which we bless Christ for aye.
Troparion. Come, let us in the vine’s new fruit participators be of
joy divine on the auspicious day of resurrection to Christ’s kingdom,
singing him, as God, for aye.
Troparion. Lift up thine eyes, O Sion, round about, and see; for, lo!
thy children come to thee, as lights by God illum’d, from the west and
from the north, from the sea and from the east, in thee blessing
Christ for aye.
Verse. O most holy Trinity, glory to thee, our God.
Troparion. Almighty Father, Word, and Spirit, nature conjoin’d in
persons three, superessential, God most high, in thee baptized we
have been, and thee we bless for evermore.
Ode ix.
Irmos. Shine, shine, O new Jerusalem; for the glory of the Lord is
risen on thee. Exult now, and rejoice, O Sion; and thou, O pure God-
bearing one, be glad at the rising of thy Child.
Verse. My soul him magnifies, who willingly did suffer and was
buried, and rose the third day from the grave, even Christ, the Giver
of life.
Troparion. O voice of thee divine, most sweet, and dear! for thou
hast promis’d undeceivingly to be with us, O Christ, until the ages
end, which holding as hope’s stablishment, let us, the faithful, joyful
be.
Verse. Christ is the Pascha new, the living sacrifice, the Lamb of
God, who the world’s sins doth take away.
Troparion. O Christ, thou great most sacred Pasch, wisdom, and
Word of God, and power! grant us in wise more perfect to partake of
thee thy kingdom’s day in that no evening hath.
Exapostilarion. Tone ii.
Asleep in flesh as mortal, King and Lord, on the third day thou
didst arise, arousing Adam from corruption and destroying death, O
Pasch of immortality, salvation of the world.
Stichera. Tone v.
Verse. Let God arise....
To-day the sacred Pascha is made manifest to us, the new, the
holy Pasch, the Pascha mystical, the Pascha all-rever’d, the Pascha,
even Christ the ransomer, the Pascha undefil’d, the Pascha great,
the faithful’s Pasch, the Pasch that opes the gates of Paradise to us,
the Pasch that halloweth all that faithful be.
Verse. As smoke is driven away....
Come from that spectacle, ye women-gospellers, and unto Sion
say, Receive from us the joyful tidings of Christ’s resurrection. Be
fervent, dance, and joy, Jerusalem, beholding Christ the King
proceed as bridegroom from the grave.
Verse. So let the sinners perish....
The women bearing myrrh at early dawn stood the Life-giver’s
grave before, and found an angel sitting on the stone, and he,
accosting them, spake thus, Why seek the living mid the dead? why
the corruptless wail as though he in corruption were? Go, tell ye his
disciples this!
Verse. This is the day which....
Pascha the fervent, Pascha, the Pascha of the Lord, the Pascha
all-rever’d hath risen on us. It Pascha is, let us with joy each other
greet. O Pascha, ransoming from grief! For, shining from the grave
to-day, as bridegroom from a bridal-room, Christ hath with joy the
women fill’d, saying, Tell the disciples this!
Glory. Both now.
It is the day of resurrection, and by the triumph be illuminate we,
and we each other greet, and Brethren! to them that hate us say, and
at the resurrection everything forgive; and on this wise let us
exclaim,
Christ is risen from the dead, death by death down doth he tread,
and on them that dwell in graves he bestoweth life. Three times.
ADDITIONAL NOTES.
A. Note that in Appendix the word translated Archpriest is in the
original Archiereus, and signifies the Bishop. There is however
another word which can only be translated into English by the term
Archpriest, namely Protoiereus, but this is a title borne by many
priests who are not of episcopal rank.
B. And note that in the Psalms the Orthodox Church follows the
Septuagint and not the Hebrew enumeration.
ERRATA.
Page xi, line 17 of Notes, omit Archpriest. A Bishop, as
being calculated to give a wrong
impression. See Additional Note A,
page xxxix.
” 51, ” 3 of foot-note, for of read in.
” 61, ” 8, and page 62, line 27, for Gallilee read
Galilee.
” 64, ” 3, for help-meet read helpmeet.
” 103, ” 16, for who read whom.
” 142, lines 10 and 11, and page 158, lines 13 and 14, for
we ask of thee, O Christ, read let us
ask of Christ.
” 158, line 4, after for insert the repose of.
” 160, ” 18, descendants’, omit the apostrophe.
Transcriber’s Note: The errata have been corrected, including any obvious errors in the
punctuation that were found.
TREBNIK.
MOSCOW.
At the Synodal Press.
MDCCCLXXXII.