You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it("should censor all vowels of profanity at the beginning of a sentence",()=>{
129
-
expect(profanity.censor("Butt is a profane word",CensorType.AllVowels)).to.equal(`B${profanity.options.grawlixChar}tt is a profane word`);
127
+
expect(profanity.censor("Butt is a profane word",CensorType.AllVowels)).toBe(`B${profanity.options.grawlixChar}tt is a profane word`);
130
128
});
131
129
132
130
it("should censor all vowels of profanity at the end of a sentence",()=>{
133
-
expect(profanity.censor("Don't be a butt.",CensorType.AllVowels)).to.equal(`Don't be a b${profanity.options.grawlixChar}tt.`);
131
+
expect(profanity.censor("Don't be a butt.",CensorType.AllVowels)).toBe(`Don't be a b${profanity.options.grawlixChar}tt.`);
134
132
});
135
133
136
134
it("should handle profane words with no vowels",()=>{
137
-
expect(profanity.censor("Don't say tsk",CensorType.AllVowels)).to.equal("Don't say tsk");
135
+
expect(profanity.censor("Don't say tsk",CensorType.AllVowels)).toBe("Don't say tsk");
138
136
});
139
137
});
140
138
describe("Case sensitivity",()=>{
141
139
it("should censor while preserving case",()=>{
142
-
expect(profanity.censor("Don't be a BuTt")).to.equal("Don't be a @#$%&!");
140
+
expect(profanity.censor("Don't be a BuTt")).toBe("Don't be a @#$%&!");
143
141
});
144
142
145
143
it("should censor all uppercase profanity",()=>{
146
-
expect(profanity.censor("DON'T BE A BUTT")).to.equal("DON'T BE A @#$%&!");
144
+
expect(profanity.censor("DON'T BE A BUTT")).toBe("DON'T BE A @#$%&!");
147
145
});
148
146
149
147
it("should censor mixed case profanity",()=>{
150
-
expect(profanity.censor("Don't Be A bUtT")).to.equal("Don't Be A @#$%&!");
148
+
expect(profanity.censor("Don't Be A bUtT")).toBe("Don't Be A @#$%&!");
151
149
});
152
150
153
151
it("should censor profanity with alternating case",()=>{
154
-
expect(profanity.censor("dOn'T bE a BuTt")).to.equal("dOn'T bE a @#$%&!");
152
+
expect(profanity.censor("dOn'T bE a BuTt")).toBe("dOn'T bE a @#$%&!");
155
153
});
156
154
});
157
155
158
156
describe("Multi-word profanities",()=>{
159
157
it("should censor multi-word profanities",()=>{
160
-
expect(profanity.censor("He's a fudge packer")).to.equal(`He's a ${profanity.options.grawlix}`);
161
-
expect(profanity.censor("That's a blow job")).to.equal(`That's a ${profanity.options.grawlix}`);
162
-
expect(profanity.censor("Don't be a son-of-a-bitch")).to.equal(`Don't be a ${profanity.options.grawlix}`);
158
+
expect(profanity.censor("He's a fudge packer")).toBe(`He's a ${profanity.options.grawlix}`);
159
+
expect(profanity.censor("That's a blow job")).toBe(`That's a ${profanity.options.grawlix}`);
160
+
expect(profanity.censor("Don't be a son-of-a-bitch")).toBe(`Don't be a ${profanity.options.grawlix}`);
163
161
});
164
162
165
163
it("should handle multi-word profanities with different censor types",()=>{
166
-
expect(profanity.censor("He's a fudge packer",CensorType.FirstChar)).to.equal(`He's a ${profanity.options.grawlixChar}udge packer`);
167
-
expect(profanity.censor("That's a blow job",CensorType.FirstVowel)).to.equal(`That's a bl${profanity.options.grawlixChar}w job`);
168
-
expect(profanity.censor("Don't be a son-of-a-bitch",CensorType.AllVowels)).to.equal(
164
+
expect(profanity.censor("He's a fudge packer",CensorType.FirstChar)).toBe(`He's a ${profanity.options.grawlixChar}udge packer`);
165
+
expect(profanity.censor("That's a blow job",CensorType.FirstVowel)).toBe(`That's a bl${profanity.options.grawlixChar}w job`);
166
+
expect(profanity.censor("Don't be a son-of-a-bitch",CensorType.AllVowels)).toBe(
169
167
`Don't be a s${profanity.options.grawlixChar}n-${profanity.options.grawlixChar}f-${profanity.options.grawlixChar}-b${profanity.options.grawlixChar}tch`,
170
168
);
171
169
});
172
170
});
173
171
174
172
describe("Input type handling",()=>{
175
173
it("should return original input for non-string input",()=>{
0 commit comments